- 論壇徽章:
- 46
|
本帖最后由 zhlong8 于 2010-11-13 20:17 編輯
很簡(jiǎn)單,這樣用根本就是錯(cuò)的,文檔說(shuō)的很清楚。ActivePerl 自帶的 perlcritic 可以檢查這種錯(cuò)誤,而 strict 查檢末聲明變量是在編譯期進(jìn)行的。
perlsynNOTE: The behaviour of a my statement modified with a statement modifier conditional or loop construct (e.g. my $x if ... ) is undefined. The value of the my variable may be undef, any previously assigned value, or possibly anything else. Don't rely on it. Future versions of perl might do something different from the version of perl you try it out on. Here be dragons. |
|