... ... #### ... #(generic code / beginning of HTML dumped here) &$op(); ... #(generic code / end of HTML dumped here) #### @safesubs = ("this_sub", "that_sub", "other_sub"); $ok = 0; #op is not okay to run until we say so ;-) foreach (@safesubs) { if($op eq $_) { $ok = 1; #if the op is safe, set $ok to true } } if($ok) { &$op(); } else { die("The op variable does not contain a valid definition"); }