Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: method dispatch question

by moritz (Cardinal)
on Jul 09, 2008 at 12:20 UTC ( [id://696439]=note: print w/replies, xml ) Need Help??


in reply to Re^2: method dispatch question
in thread method dispatch question

Even if there is a solution for that (and I don't doubt there is one, perl is full of surprising syntax ;-), you shouldn't go for it, because it's not really readable anymore.

Use a temporary variable instead.

$self->($self->get_mref(...))() won't work because $something->(...) treats $something as a sub ref. If there's a way, I suspect it involves ${...}.

Replies are listed 'Best First'.
Re^4: method dispatch question
by rhesa (Vicar) on Jul 09, 2008 at 12:41 UTC
    I think $self->${ \ $self->get_mref(...) }(...) would work, but I agree with you about the readability.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-19 20:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found