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

Re^3: method dispatch question

by rafl (Friar)
on Jul 09, 2008 at 12:35 UTC ( #696443=note: print w/ replies, xml ) Need Help??


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

Can this still be written in one line, without intermediate variable $mref?
$self->get_mref->($self, @args);

or make get_mref return a code reference that captured $self so you can omit it when calling it.

sub get_mref { my ($self) = @_; my $coderef = \&some_method; return sub { $self->$coderef(@_) }; } $self->get_mref->(@args);


Comment on Re^3: method dispatch question
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2015-08-01 03: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 (285 votes), past polls