Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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.

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://539301]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2018-06-21 01:21 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (117 votes). Check out past polls.