Hi, How do I copy the first 10 elements of @a into @b? The method that I use is long :- my @a = 1..20; my @b = ();
my $ctr = 0; foreach (@a){ if ($ctr < 10){ push @b,$_; } $ctr ++; } Thanks.
Hi, How do I copy the first 10 elements of @a into @b? The method that I use is long :- my @a = 1..20; my @b = ();
my $ctr = 0; foreach (@a){ if ($ctr < 10){ push @b,$_; } $ctr ++; } Thanks.