- or download this
foreach $x (@regex){
@bad_matches = grep ! m/$x/, @array;
}
- or download this
foreach my $regex (@regexes) {
@array = grep { ! m/$regex/ } @array;
}
- or download this
my (@array); # is populated however you originally did
my (@keepers);
...
}
# if you want it back on @array, just uncomment:
# @array = @keepers;