Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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?
Discipulus personae non gratae..
[Corion]: Your Mother: Hmm - I have the pmdev nodelet, which has some links, but I'm not sure what links/guides there are
[Corion]: pmdev wiki maybe?
[Discipulus]: uh neat karl!
[Your Mother]: Both good things to try, thank you!

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2017-07-21 08:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (319 votes). Check out past polls.