If a variable is undef it will evaluate to an empty string when used in a regex. An empty string on the right side will match any string on the left.
For example:
print "Match 1\n" if "teststring" =~ ""; print "Match 2\n" if "teststring" =~ undef; __OUTPUT__ Match 1 Match 2
In reply to Re: Help with null string behavior in regex?
by Belgarion
in thread Help with null string behavior in regex?
by McMahon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |