77. 8. コメントと正規
表現
m{# trying to cheat with cpants game ;)
use strict;
use warnings;
}x;
MONS/AnyEvent-SMTP-0.10/lib/AnyEvent/SMTP/Client.pm
78. 8. コメントと正規
表現入れ子がおかしくなる場合
$rest =~ s{
b # start at word boundary
( # begin $1 {
$urls : # need resource and a colon
[$any] +? # followed by on or more
...
) # end $1 }
...
}{<A HREF="$1">$1</A>}igox;
AUTRIJUS/Pod-HtmlHelp-1.1/WinHtml.pm
79. 8. コメントと正規表
現次の文字がデリミタになるんじゃなかったの?
unless ($$this =~ s
# {use (warnings|strict)...)K}
{use warnings...)K}
{$begin_block}s)
{
die("Could not add a begin block.n");
}
WINTRU/Carrot-1.1.309/lib/Carrot/Modularity/Package/Source_Code.pm
80. 8. コメントと正規表
現どちらのコメント?
$regexp=qr{
....
# (?{
# my $pos=pos;
# my $prev=substr($str, $pos-10, 10);
# my $post=substr($str, $pos, 10);
# print "emitted at position ",pos,...;
# })
}xs;
OPI/HTML-YaTmpl-1.8/lib/HTML/YaTmpl/_parse.pm
81. 8. コメントと正規表
現
単一行だけど x の有無で意味が変わる場
合
if ($token =~ m/[ # matches [ /x) {
DYLUNIO/Gwybodaeth-0.02/lib/Gwybodaeth/Parsers/N3.pm
83. 9. …括弧の数が
かっこをひとつ変えるとエラーに
Unmatched ) in regex; marked by <-- HERE in
m/(?:)) <-- HERE
if(my $base_elem = $doc->look_down(_tag
=> 'base', target => qr((?:)))){
84. 10. eval: 文字列の中身
は不完全なコードかも
$c->{constraint} = eval 'sub { no strict
qw/refs/; return defined &{"match_'.
$c->{constraint}.'"}(@_)}';
MARKSTOS/Data-FormValidator-4.66/lib/Data/FormValidator/Results.pm