Beefy Boxes and Bandwidth Generously Provided by pair Networks
"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

Replies are listed 'Best First'.
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?
[davido]: I have nvidia (1050ti) in one system at home. My work laptop came with a radeon/amd video system that is no longer supported by debian/ubuntu. So that being the case I'm in the "prefer nvidia even if proprietary" camp
[davido]: Especially since the laptop is only a couple years old.

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2017-05-26 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?