y***d 发帖数: 2330 | 1 $amt=1;
print $amt +1, "First\n";
print $amt + 1, "Second\n";
以上三行运行后输出
"2Second"
我本以为 +1 之间的空格没有意义,可事实是它导致了 print 的结果不同;这是
print 参数格式本身容易出错,还是我做错了什么? | w******p 发帖数: 166 | 2 in first line $amt is interpreted as the file handle, which is neither
stdout or stderr, but if you add this after after $amt=2 you'll see the
print out:
open $amt, "|cat"; # anonymous pipe |
|