Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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 pondering the Monastery: (8)
As of 2014-09-18 08:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (109 votes), past polls