Bug#923700: can't even find the file should be an error
積丹尼 Dan Jacobson
jidanni at jidanni.org
Mon Mar 4 00:31:59 GMT 2019
Package: perl
Version: 5.28.1-4
Severity: wishlist
Please make perl return a reasonable exit status like sed in this case:
$ sed 's/a/b/' /tmp/z; echo $?
sed: can't read /tmp/z: No such file or directory
2
$ perl -pwe 's/a/b/' /tmp/z; echo $?
Can't open /tmp/z: No such file or directory.
0
$ perl -pwe 'BEGIN{use warnings FATAL => q(all);} s/a/b/' /tmp/z; echo $?
Can't open /tmp/z: No such file or directory.
0
$ perl -pwe 'BEGIN{use warnings FATAL => q(all); $$SIG{__WARN__} = sub { die @_ };} s/a/b/' /tmp/z; echo $?
Can't open /tmp/z: No such file or directory.
0
FORGET IT.
$ test -f /tmp/z && perl ...
More information about the Perl-maintainers
mailing list