in reply to Bug ? Perl dumps core on reference to @_ ?

Data point, it works on *nix ( ++ the shebang line!). I added a print scalar(@args)," \@args present.",$/; giving this output:
$ ./CorionDump.pl $symbol here is *main::wrapped_NoAttr $first here is bar They are not the same. 1 @args present. This works :bar Use of uninitialized value in concatenation (.) at ./CorionDump.pl lin +e 33. This dosen't work (core dump) : foo $ ls CorionDump.pl $
The placeholder behavior you describe is for post-wrappers. In a pre-wrapper assigning to $_[-1] triggers preemption, skipping to inner layers of wrappers IIUC.

Hook::LexWrap appears to autovivify wrappers to undef in lines like:

# Hook/LexWrap.pm:43 () = $wrapper{post}->(@_, $return) if $wrapper{post};
I looks like if exists $wrapper{'post'}; should be preferred. Unfortunately, I don't use a recent enough AS installation to help with Windows specific problems, but I can imagine that undef coderefs might confuse it.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Bug ? Perl dumps core on reference to @_ ?
by TheDamian (Vicar) on Dec 02, 2001 at 05:21 UTC
    Hook::LexWrap appears to autovivify wrappers to undef in lines like:
    # Hook/LexWrap.pm:43 () = $wrapper{post}->(@_, $return) if $wrapper{post};
    It looks like if exists $wrapper{'post'}; should be preferred.
    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.
    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.