for( my $i = 0; $i <= 9; $i++ ) { do_whatever( $topten[ $i ] ); } # or foreach( @topten[ 0 .. 9 ] ) { do_whatever( $_ ); } # or @topten = @topten[ 0 .. 9 ]; do_whatever( $_ ) foreach @topten; # or $#topten = 9; do_whatever( $_ ) for @topten;
In reply to Re: Maintain a certain number of elements inside an array?
by Fletch
in thread Maintain a certain number of elements inside an array?
by drewboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |