Use references instead:
use strict; use warnings; my @testlist=(\&test1, \&test2); foreach (@testlist) { #call test $_->(); } sub test1 { print ("dear user test1 is currently running\n"); #test1 code print "test1...done\n"; } sub test2 { print ("dear user test2 is currently running\n"); #test2 code print "test2...done\n"; }
In reply to Re: strict refs usage
by GrandFather
in thread strict refs usage
by gwowi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |