Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to best pass on the context / wantarray?

by jdporter (Canon)
on Mar 26, 2006 at 23:32 UTC ( #539325=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub which_obj
    {
        # examine the calling sub's 'wantarray':
        defined( (caller(1))[5] ) ? $_[0]->copy : $_[0]
    }
    
  2. or download this
    sub foo
    {
    ...
        my $obj = $self->which_obj;
        . . .
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2014-09-16 23:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (53 votes), past polls