in reply to Avoiding user-input in sub calls.

Yet another way (OO style):
package Foo; sub one { ... } sub two { ... } sub AUTOLOAD { goto &one; } package main; # Then in your main routine Foo->$sub($data);
Doing it this way you'd have to first make sure that $sub is not one of the UNIVERSAL::* methods (can, isa, ??? -- update: or define your own 'can' and 'isa' which just goes to 'one').