$var = 'funcname'; &$var(); sub funcname { print "Hello\n" } #### use strict; # # create an anonymous function # my $func = sub { print "Sub Anonymous\n" }; # # create named sub # sub funcname { print "Sub funcname\n" } # # call anonymous subroutine # &$func(); my $mysub = 'funcname'; # # call subroutine but only with no strict references # no strict 'refs'; &$mysub(); use strict; # # or call with eval statement # eval('&'.$mysub.'()'); # # catch error from eval statement # if( $@ ) { warn($@); }