in reply to Re: Re: Re^3: Naming Subs
in thread Naming Subs
More likely though is that all the subs dealing with user commands are stored in a different module. And you can do something like:
while (<>) { my ($verb, @args) = split; no strict 'refs'; if (defined &{"Verbs::$verb"}) {"Verb::$verb" -> (@args)} else {print "No verb '$verb' implemented.\n"} }
Why one would even want to bother with a hash in between is beyond me.
Abigail
|
|---|