Help for this page

Select Code to Download


  1. or download this
    $foo =~ '^string literal$';   # Does not equal /\Q^string literal$/
    $foo =~ $string;
    ...
    $foo =~ $precompiled_regex;   # Is stringified first!
    
    $foo =~ /$precompiled_regex/; # Faster
    
  2. or download this
    # Bad: (well, it works, but not the way you want it to)
    $foo =~ $qr;
    ...
    
    # Good:
    $foo =~ s/$qr/bar/;