Eri*_*son 23
使用/ x修饰符:
my $foo = "zombies are the bombies";
if ($foo =~ /
zombie # sorry pirates
/x ) {
print "urg. brains.\n";
}
Run Code Online (Sandbox Code Playgroud)
另请参阅perlfaq6中的第一个问题.
当你在它的时候阅读所有的perlre也不会有什么坏处.
yst*_*sth 18
即使没有/ x修饰符,也可以将注释括在(?#...)中:
my $foo = "zombies are the bombies";
if ( $foo =~ /zombie(?# sorry pirates)/ ) {
print "urg. brains.\n";
}
Run Code Online (Sandbox Code Playgroud)