diff options
author | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-10-13 15:53:39 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-10-13 15:53:39 +0000 |
commit | b1681ed3d2d7fce28f676043b07816f4fad94f55 (patch) | |
tree | bac72e96dde17083b4015bd2d0381b9b818860c3 | |
parent | 13414bd57a95312231e2bee41d173b09580d2351 (diff) | |
download | perl-b1681ed3d2d7fce28f676043b07816f4fad94f55.tar.gz |
If /dev/null is not readable, perl -e fails with
an obscure error message. Make it more understandable.
p4raw-id: //depot/perl@25753
-rw-r--r-- | perl.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -3607,8 +3607,11 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, SV *sv) #endif /* IAMSUID */ if (!PL_rsfp) { /* PSz 16 Sep 03 Keep neat error message */ - Perl_croak(aTHX_ "Can't open perl script \"%s\": %s\n", - CopFILE(PL_curcop), Strerror(errno)); + if (PL_e_script) + Perl_croak(aTHX_ "Can't open "BIT_BUCKET": %s\n", Strerror(errno)); + else + Perl_croak(aTHX_ "Can't open perl script \"%s\": %s\n", + CopFILE(PL_curcop), Strerror(errno)); } } |