A
Anno Siegel
John W. Krahn said:(e-mail address removed) wrote:for ( reverse 0..$#my_array) {
unshift @new_array, splice @my_array, $_, 1 if $my_array[$_] =~
/new/;
}
Or:
push @{ /new/i ? \@new_array : \@my_array }, $_ for splice @my_array;
Ah... splice with just an array clears the array and returns a copy. I never
noticed.
Anno