Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: For clarity and cleanliness, I'd recommend...

by saskaqueer (Friar)
on Mar 06, 2005 at 08:05 UTC ( #437015=note: print w/ replies, xml ) Need Help??


in reply to Re: For clarity and cleanliness, I'd recommend...
in thread looking for a good idiom: return this if this is true

This works fine, and does not clobber $_.

#!/usr/bin/perl -w use strict; print test(), $/; sub subtest { return 4 } sub test { return $_ if ( local $_ = subtest() ); # continue return 'false'; }


Comment on Re^2: For clarity and cleanliness, I'd recommend...
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://437015]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2015-07-01 23:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls