This works just fine. The included variable contents in $pat cannot cause the delimiters to be prematurely recognized; that phase is already long past.my $pat = "/etc/"; my $string = "/usr/etc/config"; if ($string =~ m/$pat/x) { print "it matches\n"; }
-- Randal L. Schwartz, Perl hacker
In reply to Re: Converting RegExs.
by merlyn
in thread Converting RegExs.
by dcorbin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |