can returns a code ref so you don't need to turn off strictures, just:
use strict; use warnings; my $funcName = 'doit'; if (my $cando = main->can ($funcName)) { $cando-> (); } sub doit { print "I done it\n"; }
Prints:
I done it
In reply to Re^2: Taking reference to function
by GrandFather
in thread Taking reference to function
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |