Bug#744751: perl -i ignores errors (!)

Ian Jackson ijackson at chiark.greenend.org.uk
Mon Apr 14 11:02:51 UTC 2014


Package: perl
Version: 5.14.2-21+deb7u1
Severity: grave

Oh dear:

mariner:~/junk> perl -i.bak -pe '' nonexistent
Can't open nonexistent: No such file or directory.
mariner:~/junk> echo $?
0
mariner:~/junk>

I appreciate that fixing this is likely to break things which were
relying on the fault-oblivious[1] approach but overall I think it's
necessary.

Incidentally, autodie doesn't help:

mariner:~> perl -Mautodie -i.bak -pe '' nonexistent
Can't open nonexistent: No such file or directory.
mariner:~> echo $?
0
mariner:~>

Ian.

[1] http://catless.ncl.ac.uk/Risks/19.64.html#subj1




More information about the Perl-maintainers mailing list