Thanks - Re: multiple greps in if()

2002-04-25 Thread Steven_Massey
Excellent thanks felix and michael. Felix Geerinckx <[EMAIL PROTECTED]> on 04/25/2002 02:12:17 PM To: [EMAIL PROTECTED] cc: Subject: Re: multiple greps in if() on Thu, 25 Apr 2002 12:54:53 GMT, [EMAIL PROTECTED] (Steven Massey) wrote: > ideally I would like multiple grep

Re: multiple greps in if()

2002-04-25 Thread Michael Lamertz
On Thu, Apr 25, 2002 at 01:54:53PM +0100, [EMAIL PROTECTED] wrote: > Hi > > anyone have any ideas on how example 2 or 3 below should correctly be > written ??? Actually your code can be interpreted in different ways. I guess you'll need the following: -- perldoc -f grep --

Re: multiple greps in if()

2002-04-25 Thread Felix Geerinckx
on Thu, 25 Apr 2002 12:54:53 GMT, [EMAIL PROTECTED] (Steven Massey) wrote: > ideally I would like multiple grep pairs ie.. > if(grep /(Handicap && Help) || (Friend && Foe)/, $source) { > this does not work > } Put the '&&' outside of the pattern: #! perl -w use strict; my @strings

multiple greps in if()

2002-04-25 Thread Steven_Massey
Hi anyone have any ideas on how example 2 or 3 below should correctly be written ??? Thanks for any help that can be given if(grep /Handicap|Help/, $source) { this seems to work } if(grep /(Handicap && Help)/, $source) { this does not work } ideally I would like multiple grep pairs ie.. if(gre