in reply to Re^3: Use grep with two arrays
in thread Use grep with two arrays

And to then avoid reproducing code (which probably negates the advantages of not using a temp variable) (untested):

@array1 = @array1[slicer(@array1)]; @array2 = @array2[slicer(@array1)]; sub slicer { grep { $_[$_] =~ /keep these/ } 0 .. $#_; }

    -Bryan