Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Elegant way to return true or nothing from a subroutine?

by pdcawley (Hermit)
on Oct 10, 2006 at 11:00 UTC ( #577369=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub foo {
        shift->{some_obj}->some_method && 1 || return
    }
    
  2. or download this
    sub foo {
        shift->{some_obj}->some_method || return
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (1)
As of 2022-07-07 11:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?