Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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?
[erix]: probably misremembered because of 2>&1 |
[erix]: oh nice, can do |& nowadays. Learned something new after all
LanX flagelates erix with a signed markov chain
[erix]: oh well, it's holy week, right? Thick-skin week. I just read that in the Philippines, some RCs practice self-crucifixion. Tough cookies I'd like to see
[LanX]: already?
[erix]: I don't know really. I thought so.
[LanX]: April 16th
[erix]: ah no, 16 april. some time to go yet :)

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2017-03-23 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (285 votes). Check out past polls.