Hook::LexWrap appears to autovivify wrappers to undef in lines like:Perhaps from an aesthetic point-of-view, but it makes absolutely no difference in terms of behaviour. Testing $wrapper{'post'} in an if will not autovivify it. And even if it did, it would autovivify to undef, so the if would still fail, preventing the undefined value from ever actually being used as a subroutine reference.It looks like if exists $wrapper{'post'}; should be preferred.# Hook/LexWrap.pm:43 () = $wrapper{post}->(@_, $return) if $wrapper{post};
I can imagine that undef coderefs might confuse it.Quite probably. But only if they were actually ever called, which the if $wrapper{'post'}; ensures they never will be.
In reply to Re: Re: Bug ? Perl dumps core on reference to @_ ?
by TheDamian
in thread Bug ? Perl dumps core on reference to @_ ?
by Corion
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |