in reply to Help with null string behavior in regex?
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
|
|---|