- or download this
my $r = bless qr/foo/, "MyPackage";
- or download this
my $r = bless \qr/foo/, "MyPackage";
- or download this
$ perl -le 'my $r = "bar"; print "yes" if "foobarbaz" =~ $r'
yes
- or download this
#!/usr/bin/perl -w
use strict;
...
print '"stringified" matched $plain' if "stringified" =~ $plain;
__END__
"stringified" matched $plain
- or download this
#!/usr/bin/perl -w
use strict;
...
$ob isa Regexp
$qr: (?-xism:foo)
$ob: Regexp=SCALAR(0x805f148)