replacing multiple matches with an array

2005-01-17 Thread B McKee
Hi All I have this bit of code in a program I'm working on. while (RAWREPORT) { next if /\f/ ; next if /^DATE : / ; next if /^\s{15,}PART / ; next if /^COUNTER QTY/ ; next if /^\s+$/ ; print ; #

Re: replacing multiple matches with an array

2005-01-17 Thread JupiterHost.Net
Hello, I believe this will do what you want: next if grep { $rawreport_item =~ /$_/ } @possibleMatches; Just make sure the regexes in @possibleMatches are not user supplied or they may try sneaky bad things :) perl -mstrict -we 'my @m = (q(^\d+$), q(^\w+$)); for my $item (qw(123 abc 1-2we)){

Re: replacing multiple matches with an array

2005-01-17 Thread John W. Krahn
B McKee wrote: Hi All Hello, I have this bit of code in a program I'm working on. while (RAWREPORT) { next if /\f/ ; next if /^DATE : / ; next if /^\s{15,}PART / ; next if /^COUNTER QTY/ ; next if /^\s+$/ ;