Slightly different approach. Hey, variety is the spice of life!
use strict; use warnings; sub Handler::a1 { print("a1\n"); } sub Handler::a2 { print("a2\n"); } for (1..3) { exists($Handler::{'a'.$_}) ? &{$Handler::{'a'.$_}} : print "no handler for $_\n"; }
In reply to Re: How can I call subroutines in an array
by eyepopslikeamosquito
in thread How can I call subroutines in an array
by ozgurp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |