$in=param('in'); @actions=qw(this that foo bar zzz); # names of subroutines and input values foreach $_(@actions){ if($in eq $_){&$_()}}