pvinodp
asked on
using perl's match m/ in a if condition
using the m/ to match multiple options..
my $fallQ = func1();
# $fallQ could be any word, but i want a if condition which succeds only if the $fallQ is either ASM or ac or per. Alsothe match should be case insensitive..
i tried if ($fallQ =~ m/[AC|ASM|PER]/i) {
#do important stuff;
}
But this did not work
my $fallQ = func1();
# $fallQ could be any word, but i want a if condition which succeds only if the $fallQ is either ASM or ac or per. Alsothe match should be case insensitive..
i tried if ($fallQ =~ m/[AC|ASM|PER]/i) {
#do important stuff;
}
But this did not work
if ($fallQ =~ m/(AC|ASM|PER)/i) ...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks all