Help for this page

Select Code to Download


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