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".(); # gives me "No such method 'CALL-ME' for invocant of type 'Str'"

thanks,

--
Theo van den Heuvel
Van den Heuvel HLT Consultancy

Reply via email to