in reply to using && with regex in an if() statement
whereas reversing bar and foo in the sentence cause the test to fail.my $sentence = 'I got a foo and a bar in me'; if ($sentence =~ /foo/gis && $sentence =~ /bar/gis) { print "I'm doing something with $sentence\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using && with regex in an if() statement
by Tachoknight (Initiate) on Mar 14, 2006 at 22:20 UTC |