Another approach, rather than checking to see if there is a value in $1, $2 and $3, could be to do something like:
Code:
if ($someVar =~ m/(.)(..)(...)/) {
# execute this block if the regex succeeds
# also means $1, $2 and $3 were set
} else {
# regex did not match - execute this block
}
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.