develooper Front page | perl.perl5.porters | Postings from May 2004

Re: [perl #29094] prefix errors with name of program

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
May 3, 2004 14:42
Subject:
Re: [perl #29094] prefix errors with name of program
Message ID:
20040503214727.GK1895@iabyn.com
On Fri, Apr 23, 2004 at 06:00:06AM -0000, Dan Jacobson wrote:
> Today again lots of head scratching because bash and perl don't prefix
> their error messages with a "bash:" or a "perl:", so bash scripts with
> bits of perl often take deep scrutinization to figure out what the
> problem was.

That may well be the case, but Perl has done its error messages this way
for 16 years, and changing it now would boringly break lots of things.

If you're really desperate for this feature, you can do something like
this:

    $ ./perl -e '$SIG{__DIE__}=sub{print STDERR"Perl: ",@_;exit 1}; $x/=$y'
    Perl: Illegal division by zero at -e line 1.

-- 
The Enterprise successfully ferries an alien VIP from one place to another
without serious incident.
    -- Things That Never Happen in "Star Trek" #7

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About