From: "JupiterHost.Net" <[EMAIL PROTECTED]>
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 :)


yep - strictly hardcoded for this useage.

perl -mstrict -we 'my @m = (q(^\d+$), q(^\w+$)); for my $item (qw(123 abc 1-2we)){ next if grep { $item =~ /$_/ } @m; print "$item\n"; }'
HTH :)
Lee.M - JupiterHost.Net


Thanks Lee - that does look like what I was thinking of.

great ;p

I'm now using
while (<RAWREPORT>) {
my @linesToDiscard = ( q(\f), q(^DATE : ), q(^\s{15,}PART ), q(^COUNTER QTY), q(^\s+$) ) ;

Why redefine @linesToDiscard which each $_ ?

my @linesToDiscard = ('\f','^DATE : ','^\s{15,}PART ','^COUNTER QTY','^\s+$');
while(<RAWREPORT>) {
...


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to