Beefy Boxes and Bandwidth Generously Provided by pair Networks chromatic writing perl on a camel
"be consistent"
 
PerlMonks  

Re: how can I store a reference to a method/function along with the parameters?

by Skeeve (Vicar)
on Aug 11, 2011 at 19:34 UTC ( #919940=note: print w/ replies, xml ) Need Help??


in reply to how can I store a reference to a method/function along with the parameters?

try

my $meth_with_param= sub { myMethod('My Param'); };


s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
+.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e


Comment on Re: how can I store a reference to a method/function along with the parameters?
Select or Download Code
Re^2: how can I store a reference to a method/function along with the parameters?
by JavaFan (Canon) on Aug 11, 2011 at 21:11 UTC
    Or even:
    my $meth_with_param = sub {myMethod('My Param', @_)};
    so you can call $meth_with_param->(1, 2, 3); which then will call myMethod('My Param', 1, 2, 3)
Re^2: how can I store a reference to a method/function along with the parameters?
by noelgolding (Initiate) on Aug 12, 2011 at 13:03 UTC
    Thanks, this is exactly what I was looking for. I don't know how to mark this question as answered, and to mark your reply as the solution. But I really appreciate the help.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2014-04-19 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (478 votes), past polls