use strict; use warnings; for my $a qw( test1 test2 ) { no strict 'refs'; &$a; } sub test1 { print 'test1'; } sub test2 { my $x='test3'; &$x }