in reply to Avoiding user-input in sub calls.

What you are trying to write is like a message despatcher, and Yes there are many techniques -

Method 1
if (condition1) { code_for_condition1($data) } elsif (condition2) { code_for_condition2($data) } else { default_condition($data) }
The first method is the obvious method, it is not necessarily a bad method at all.

Method 2
%despatcher = ( ident_1 => \*code_for_condition1, ident_2 => \*code_for_condition2, ... }; &$despatcher{$identifier}($data); sub code_for_condition1 { ... } sub code_for_condition2 { ... }
The second method using a hash table requires more Perl knowledge. It has a slightly more complicated syntax structure, and a hash table overhead. It is nevertheless a good method.

<TO BE CONTINUED...>Too late for bed time tonight, I will add some more tomorrow...