You could use string eval, if I understand your question correctly.
use strict; use warnings; use Test::More; sub square { my $num = shift; return $num*$num; } my $subname = 'square'; is( eval "&$subname(4)", 16 ); done_testing;
Hope this helps!
In reply to Re: How to make a variable in hard call.
by 1nickt
in thread How to make a variable in hard call.
by Konan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |