COMMAND
Orginal non-OO: &{\&{$testname}}($system);
updated as OO: $self->{&{\&{$testname}}}->($system); #system is hashr
+ef
With the updated post above, it becomes clear that
BrowserUk's
suggestion is correct. The code:
&{\&{$testname}}($system);
translates to
$testname->($system); with a
hack to get around the ban on
Symbolic references. Essentially, you have a scalar storing the name of that routine, which then calls that function with the argument
$system. To change that to a method call on
$self, you would want
$self->$testname($system);
as documented in
Method Names as Strings in
perlobj.
#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.