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').package Foo; sub one { ... } sub two { ... } sub AUTOLOAD { goto &one; } package main; # Then in your main routine Foo->$sub($data);
In reply to Re: Avoiding user-input in sub calls.
by runrig
in thread Avoiding user-input in sub calls.
by pekkhum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |