Closed p5pRT closed 20 years ago
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.
It's as if each author never expected any embedding of scripts. Make might call bash might call perl. Make says "make:"\, but highfalutin bash and perl act like "why of course\, were you expecting to be running something else?"
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
The RT System itself - Status changed from 'new' to 'open'
@iabyn - Status changed from 'open' to 'resolved'
On Mon\, May 03\, 2004 at 10:47:27PM +0100\, Dave Mitchell \davem@​iabyn\.com wrote:
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\.
That requires that you already suspect that it is a perl error\, in which case you can look it up via man perldiag (or pipe the error to the splain utility to do it for you). perldiag contains (we hope) all perl issued error messages\, as well as\, for convenience\, many shell errors that can result from erroneously feeding perl code to a shell.
Migrated from rt.perl.org#29094 (status was 'resolved')
Searchable as RT29094$