如果我的gz文件不存在,为什么不这样做呢?为什么如果文件不在那里,我的Perl管道就不会死?
$ cat test.pl
open(FILE, "zcat dummy.gz |") or die "DIE";
$ ./test.pl
zcat: dummy.gz: No such file or directory
如果我读文件通常,它按预期工作:
$ cat test2.pl
open(FILE, "dummy.gz") or die "DIE";
$ ./test2.pl
DIE at ./test.pl line 2.