... # FAILS $file = 'C:\tmp'; $regex = qr~C:\\tmp~; if ($file =~ m/$regex/i) { print "\nTest with backslashes -- If stmt is true...\n"; }
Prints...
Test with forward slashes -- If stmt is true... Test with backslashes -- If stmt is true...
FYI coding while tired is a recipe for adding errors to code that you will find hard to find later.
Celebrate Intellectual Diversity
In reply to Re: Regex Mystery
by InfiniteSilence
in thread Regex Mystery
by roho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |