Next | Hook::LexWrap | 20 |
This subterfuge isn't quite perfect
sub prewrap { local $^W = 1; my $x = $_[-1] . "Yahoo Serious"; print defined($_[-1]) ? "However, \$_[-1] is actually defined\n" : "\$_[-1] is undef, as promised\n"; }
sub myfunction { }
wrap 'myfunction' , pre => \&prewrap; my $dummy = myfunction();
The output:
Use of uninitialized value in concatenation (.) or string at Test7.pl line 6. However, $_[-1] is actually defined
So much for "In a pre-wrapper, $_[-1] is undef. "
Next | Copyright © 2003 M. J. Dominus |