I'm puzzled as to why you switched to double quotes and then had to escape the backslash in your third pattern. Sticking to single quotes or using qw{ ... } would have obviated that need.
$ perl -le ' > $line = qq{;\n}; > print > $line =~ m{$_} > ? q{} > : q{no }, > qq{match $_} > for q{^;$}, q{^;}, q{^;\z};' match ^;$ match ^; no match ^;\z $ perl -le ' $line = qq{;\n}; print $line =~ m{$_} ? q{} : q{no }, qq{match $_} for qw{ ^;$ ^; ^;\z };' match ^;$ match ^; no match ^;\z $
Cheers,
JohnGG
In reply to Re^3: How to match a ;
by johngg
in thread How to match a ;
by ewhitt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |