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.
|
|---|