#! perl -slw use strict; my @array = qw[ x x y z z z ]; my @idxs = 0; $array[$_-1] ne $array[$_] and push @idxs, $_-1, $_ for 1 .. $#array; push @idxs, $#array; print "@idxs";
In reply to Re: Grabbing slices
by BrowserUk
in thread Grabbing slices
by Evanovich
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |