my @idxs = (0); my $i; foreach $i (1 .. $#array) { if ($array[$i - 1] ne $array[$i]) { push @idxs, $i - 1, $i; } } push @idxs, $#array; print "@idxs";
In reply to Re: Re: Grabbing slices
by jgallagher
in thread Grabbing slices
by Evanovich
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |