Mailing List Archive

$SIG{__DIE__} (was Re: Over-zealous warnings ignore eval)
On Wed, 30 Aug 1995, Larry Wall wrote:

> : % perl -le 'print "here"; eval q(a "b"); print "there"'
> : here
> : String found where operator expected at (eval 1) line 1, near "a "b""
> : (Do you need to predeclare a?)
> : there
>
> $SIG{__WARN__} was construed as a fix for this, or at least a workaround.
> It's hard to know how best to handle this in the general case. The current
> default is to err on the side of providing too much information rather
> than too little.

That reminds me of something else. I just tried using $SIG{__DIE__}, but
I must say that the behaviour isn't too helpful in my case. It always
appends the line and file info (if no LF.) I was hoping that I could
override this.

Spefically, in working on the POD stuff, it would be great if:

die "L<...> may not contain nested commands";

could be turned by $SIG{__DIE__} into:

die "L<...> may not contain nested commands near line $line of $ARGV.\n";

Unfortunately, it seems that just can't be done right now.

--
Kenneth Albanowski (kjahds@kjahds.com, CIS: 70705,126)