in reply to looking for a good idiom: return this if this is true
if you wouldn't mind refactoring thatroutine, this works:
Ugly as hell but it appears to work.sub thatroutine(\$) { # do something to ${$_[0]} } sub thisroutine { return $_ if thatroutine local $_; ... my $namedvar; return $namedvar if thatroutine $namedvar; }
|
---|
In Section
Seekers of Perl Wisdom