perl heredoc refernce
>>’HEREDOC’; >和标识符之间没有空格
第一个标识符HEREDOC;$,第二个标识符^HEREDOC$(懂我意思吧)
‘HEREDOC’:单引号标记的标识符变量不能转义
“HEREDOC”:双引号标记的标识符变量可以转义
heredoc内容必须靠左
my $message = <<‘HEREDOC’; ... HEREDOC
perl裸字参考博客
perl裸字参考博客
perl胖逗号参考博客
创建key-value list时需要使用胖逗号(fat comma),胖逗号会移除key字符串必须加引号的限制。
my %hash = ( sq => "chuang", mw => "chuang", xy => "yummy" ); my %hash = ( 'sq','chuang', 'mw','chuang', 'xy','yummy' );
perl运算符/优先级参考
perl special variable reference
# if block if() { ... } elsif(){ ... } else { ... }
# while block while(){ ... } continue{ ... }
# until block until(){ ... } continue{ ... }
# for block for(initial;judge;action){ ... }
# foreach block foreach my $var (list){ ... }