in reply to subroutine refs

You're using a symbolic reference which can be Very Dangerous and produce Unexpected Results if the variable containing the subroutine name gets hold of a Reserved Word. Create a hash of references to subroutines. (or a hash of anonymous subroutines, since the names are superfluous at that point)
my $subs = { "joes_routine" => \&joesub, "marks_routine" => \&marksub, ... }; $subchoice = GetSubToUse(); @args = GetSubArgs(); $subs->{$subchoice}->(@args);

Replies are listed 'Best First'.
Re^2: subroutine refs
by lancer (Scribe) on Jul 25, 2015 at 14:03 UTC
    In case if the variable can contain a reserved word, one could check the variable against a list of all reserved words, before calling it.