Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by BrowserUk (Pope)
on Mar 26, 2006 at 18:18 UTC ( #539301=note: print w/ replies, xml ) Need Help??


in reply to How to best pass on the context / wantarray?

I'm probably missing something, but isn't that just

sub frobnicate_position { my $obj = defined wantarray ? $_[0]->copy() : $_[0]; ... calculate new position here, ... set $obj->line() and $obj->column() return $obj };

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: How to best pass on the context / wantarray?
Download Code
Replies are listed 'Best First'.
Re^2: How to best pass on the context / wantarray?
by Corion (Pope) on Mar 26, 2006 at 18:20 UTC

    D'oh - talk about not seeing the forest for the trees :-)

    Of course, any other suggestions are still welcome, but I guess it'll be hard to improve on BrowserUK's suggestion

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2015-07-28 09:56 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 (254 votes), past polls