in reply to Re: Re: Re: Re: Making a hash of making a hash of an array
in thread Making a hash of making a hash of an array
This is one of the jobs that last was built for. Now consider this one:my @array = (1..20); my $i = 0; for (@array) { print "$_\n"; last if ++$i >= 10; }
That's called an array slice, another tool that seperates Perl from C. Play around with these two snippets. You'll learn something. ;)my @array = (1..20); print "$_\n" for @array[0..9];
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|