On Tue, Aug 9, 2016 at 3:49 AM, Theo van den Heuvel
wrote:
> I have string variable and want to execute a function with that name. How
> do I call that function?
>
> sub bar { say "Hi" }
> my $subname = 'bar';
>
> # how to call the sub whose name I have?
>
Hi all,
I have seen this somewhere in the docs, but can't find it for the life
of me.
I have string variable and want to execute a function with that name.
How do I call that function?
sub bar { say "Hi" }
my $subname = 'bar';
# how to call the sub whose name I have?
"$name".();