http://www.perlmonks.org?node_id=438245


in reply to looking for a good idiom: return this if this is true

if you wouldn't mind refactoring thatroutine, this works:

sub thatroutine(\$) { # do something to ${$_[0]} } sub thisroutine { return $_ if thatroutine local $_; ... my $namedvar; return $namedvar if thatroutine $namedvar; }
Ugly as hell but it appears to work.