Next | Hook::LexWrap | 17 |
Scalar context could have worked the same way as list context
Perhaps something like this:
$prereturn = $return = []; $dummy = $wrapper{pre}->(@_,$return) if $wrapper{pre}; if (ref $return eq 'ARRAY' && $return == $prereturn && !@$return) { $return = &$original; $dummy = $wrapper{post}->(@_, $return) if $wrapper{post}; } return $return;
Except for one little problem
The manual promises:
In a pre-wrapper, $_[-1] is -- for obvious reasons -- undef.
If the code were as above, $_[-1] would not appear to be undef
It would appear to be a listref
Next | Copyright © 2003 M. J. Dominus |