这里是我的代码为什么系统调用会影响perl中的后续打印行为?
#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;
my $file = $ARGV[0];
system('wc -l $file');
print "\nprinting alpha \n";
sleep 1;
exit;
后,我走(tcsh
壳)perl script.pl /path/to/file
我没有看到printing alpha
,直到我按Ctrl+C
。即使在系统调用之前或之后添加另一条语句$|=1
,行为仍然相同。
发生了什么事?
感谢您的回答。我不得不接受另一个,因为它通知更多,但你也没关系。 – user13107 2013-03-15 06:55:32