You could pass another argument to your sub, such as a reference to a hash of options.
In reply to Re: updating code with getopt::long by toolic in thread updating code with getopt::long by madM