in reply to Using a 'getopt' in module code

Strongly recommend using Params-Validate in named params (hash or hashref) mode, and TheDamian's advice in Perl Best Practices - the sample chapter is conveniently the one you want.