http://qs321.pair.com?node_id=139055


in reply to Command line tool coding style?

That's clever, though you should wrap the method call in an eval block or check can to prevent catastrophic failure if someone asks for an undefined action. Generally I use a dispatch table (hash) of subrefs, but this also works.

(You can safely omit either -w or warnings, and you don't need srand if you're using a Perl with the warnings pragma.)