in reply to calling functions from data in variables

Update: I managed to fool myself but not broquiant. The -MStrict below is completely useless as there is no module Strict, only strict. So the following will only work without stricture. Which is one reason why there is probably a better way to do this.

I wish there was a switch to enable stricture!

You could do

P:\test>perl -wMStrict -le"sub func{ print 'Hello world'; } my $funcna +me='func'; &$funcname;" Hello world P:\test>perl -wMStrict -le"sub func{ print 'Hello world'; } &{ $ARGV[0 +] };" func Hello world

but there are probably better ways of achieving your aims, but it would requires a better description of those aims.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
If I understand your problem, I can solve it! Of course, the same can be said for you.