- or download this
my $rx = 'abc';
my $qr = qr/$rx/;
...
else {
print "ABC does not match /abc/i\n"
}
- or download this
#!/usr/bin/perl -w
use strict;
...
"the alphabet ends with XYZ" =~ /xyz/i => (pattern) match
dot-matches-all (qr) does not match
dot-matches-all (literal) matches
- or download this
$ perl -e 'for (qw( i x s m )) {print eval "qr/perl/$_", "\n"}'
(?i-xsm:perl)
(?x-ism:perl)
(?s-xim:perl)
(?m-xis:perl)