From: Rafael Garcia-Suarez Date: Thu, 13 Oct 2005 15:53:39 +0000 (+0000) Subject: If /dev/null is not readable, perl -e fails with X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b1681ed3d2d7fce28f676043b07816f4fad94f55;p=p5sagit%2Fp5-mst-13.2.git If /dev/null is not readable, perl -e fails with an obscure error message. Make it more understandable. p4raw-id: //depot/perl@25753 --- diff --git a/perl.c b/perl.c index a1667c8..42f32fe 100644 --- a/perl.c +++ b/perl.c @@ -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)); } }