[ale] OT: one for the Perl Guru's

Fletch fletch at phydeaux.org
Tue Apr 29 15:15:22 EDT 2003


>>>>> "Robert" == Robert L Harris <Robert.L.Harris at rdlg.net> writes:

    Robert> Problem with this grep is that I have a sentance such as

    Robert> <Header crap> File Foo changed size while backups wile
    Robert> running on host Bar

    Robert> There's a couple other variations but I'd like it to next
    Robert> if they're there also.  The keys are pretty much 3-4 word
    Robert> phrases.

Aaah, I misread the problem.  You still can use grep, you just use it
a little differentently.  You can give grep an arbitrary EXPR (or
BLOCK) to evaluate, it doesn't have to be just a m//.


my @ignore = ( qr/changed size/,
               qr/file removed/,
               qr/warp core breach imminent/,
              );
                
while( my $line = <> ) {
  next if grep $line =~ $_, @ignore;  

  ## go on and process interesting $line
}


-- 
Fletch                | "If you find my answers frightening,       __`'/|
fletch at phydeaux.org   |  Vincent, you should cease askin'          \ o.O'
770 294-0820 (m)      |  scary questions." -- Jules                =(___)=
                      |                                               U
_______________________________________________
Ale mailing list
Ale at ale.org
http://www.ale.org/mailman/listinfo/ale





More information about the Ale mailing list