I'm sure there is a way to shorten the way I'm performing this test statement.
In the script below the test statement is looking for two separate conditions.
Is there a way to shorten it by not having to specify the variable twice?
Thanks in advance


#!/usr/local/bin/perl -w
@LIST = qw(fred joe bob john dude eddie rob);
foreach $i(@LIST){
if ($i =~ "joe" | $i =~ "dude"){ #<--- this is what I want to shorten-------->#
print "$i\n";}
}






--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to