develooper Front page | perl.perl5.porters | Postings from December 2008

[perl #60872] Perldiag doesn't contain "No such hook"

From:
Steve Peters via RT
Date:
December 2, 2008 05:59
Subject:
[perl #60872] Perldiag doesn't contain "No such hook"
Message ID:
rt-3.6.HEAD-10965-1228191640-1510.60872-15-0@perl.org
On Wed Nov 26 17:26:58 2008, hansmu@x4all.nl wrote:
> This is a bug report for perl from hansmu@x4all.nl,
> generated with the help of perlbug 1.35 running under perl v5.8.6.
> 
> 
> -----------------------------------------------------------------
> [Please enter your report here]
> 
> Perldiag does not explain what the message "No such hook" means.
> 
> This can be reproduced by:
> 
> 	perl -Mdiagnostics -e '$SIG{__FOO__} = sub {};'
> 
> This reports:
> 
> Uncaught exception from user code:
>         No such hook: __FOO__ at -e line 1.
>  at -e line 1
> 
> Notice how diagnostics thinks this exception is thrown by user code,
> when in fact the %SIG is part of the core.
> 
> -- HansM
> 

I've added necessary diagnostics with change #34975.  The code above now reports...

riker:perl-current tanya$ ./perl -Ilib -Mdiagnostics -e '$SIG{__FOO__} = sub {};'
No such hook: __FOO__ at -e line 1 (#1)
    (F) You specified a signal hook that was not recognized by Perl.  Currently, Perl 
    accepts __DIE__ and __WARN__ as valid signal hooks.

Steve Peters



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