in reply to Re: test if a string contains a list member
in thread test if a string contains a list member
I went over my script in light of all the excellent comments, and now I have something I think is much nicer.
my @offensive_words = qw( smurf fork rake ); my $bad = join('|', @offensive_words); $bad = qr($bad); ... open FH, $filename; while(<FH>){ /($bad)/oi and push( @rude_quotes, $1) and next; /^\d{4}-(.+)/os and push( @witty_quotes, $1 ); }
So now I get what I wanted, and also nice array of rude quotes which is sure to come in handy...
Thanks again!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: test if a string contains a list member
by demerphq (Chancellor) on Oct 21, 2001 at 17:41 UTC | |
by tilly (Archbishop) on Oct 21, 2001 at 19:32 UTC | |
by demerphq (Chancellor) on Oct 21, 2001 at 20:55 UTC | |
by mojotoad (Monsignor) on Nov 07, 2002 at 16:52 UTC |