in reply to Multiple matching using m///
my @patterns = (qr/balls/, qw/rings/); my @file = <IN_FILE>; my @to_print; foreach my $line (@file) { push @to_print, $line unless grep { $line =~ /$_/ } @patterns; } print OUT_FILE @to_print;
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|