in reply to how can I store a reference to a method/function along with the parameters?
output:use strict; sub myMethod { my $self = shift; my ($param) = @_; if ($param) { print "Woohoo, you have successfully passed in a parameter ($p +aram).\n"; } else { print "You have not attempted to pass in a parameter.\n"; } } my ($method, @params) = ('myMethod', 'foo'); my $object = bless {}; $object->$method(@params);
:! perl -w meth.pl Woohoo, you have successfully passed in a parameter (foo).
|
|---|