Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: looking for a good idiom: return this if this is true

by redlemon (Hermit)
on Mar 10, 2005 at 13:47 UTC ( #438245=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://438245]
help
Chatterbox?
[Corion]: acapella hessian rap, but they also do melodic stuff, like Shout (Tears for Fears)
[karlgoethebier]: Rap rhymes to crap. Ouch!
[karlgoethebier]: Unne hip unne hop unne schoppe inne kopp...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-11-18 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?