Skip to content

Instantly share code, notes, and snippets.

@kell05
Created February 21, 2012 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kell05/1875618 to your computer and use it in GitHub Desktop.
Save kell05/1875618 to your computer and use it in GitHub Desktop.
Passing regex
# http://stackoverflow.com/questions/125171/passing-a-regex-substitution-as-a-variable-in-perl
$pattern = qr/foo/;
print "match!\n" if $text =~ $pattern;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment