in reply to Re: looping backwards
in thread looping backwards
Very nice. Minor shortening to:
@arr [@arr - $o .. $#arr, 0 .. $#arr - $o]
Using the % trick, you might try this instead:
@arr [map $_ % @arr, @arr - $o .. @arr - $o + $#arr] or: my $p = @arr - $o; @arr [map $p++ % @arr, @arr]
So your slice looks a bit better.
|
|---|