How do you put comments inside a Perl regular expression?
Use the /x modifier:
my $foo = "zombies are the bombies"; if ($foo =~ / zombie # sorry pirates /x ) { print "urg. brains. "; }
Also see the first question in perlfaq6.
Also it wouldn't hurt to read all of perlre while you're at it.
1.4m articles
1.4m replys
5 comments
57.0k users