Next | Hook::LexWrap | 18 |
Instead, the code looks like this:
$return = bless sub {$prereturn=1}, 'Hook::LexWrap::Cleanup'; my $dummy = $wrapper{pre}->(@_, $return) if $wrapper{pre}; unless ($prereturn) { $return = &$original; $dummy = scalar $wrapper{post}->(@_, $return) if $wrapper{post}; } return $return;
If the prewrapper overwrites $_[-1], this overwrites $return
Since $return is a Hook::LexWrap::Cleanup object, Hook::LexWrap::Cleanup::DESTROY is called
sub DESTROY { $_[0]->() }
This invokes sub {$prereturn=1}
So the unless block is skipped
Next | Copyright © 2003 M. J. Dominus |