I don't get it. Instead of
say for do { my @arr = @arr[ 0 .. $#arr - 1 ]; @arr};
et al, why not just
say for do { @arr[ 0 .. $#arr-1 ] };
or (much) better yet...
>perl -wMstrict -lE "my @arr = qw{ one two three four }; say for @arr[ 0 .. $#arr-1 ]; say qq{@arr}; " one two three one two three four
In reply to Re^2: foreach only for a section of a list
by AnomalousMonk
in thread foreach only for a section of a list
by dizou
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |