I know how to use Perl’s Getopt::Long, but I’m not sure how I can configure it to accept any ‘–key=value’ pair that hasn’t been explicitly defined and stick it in a hash. In other words, I don’t know ahead of time what options the user may want, so there’s no way for me to define all of them, yet I want to be able to parse them all.
Suggestions? Thanks ahead of time.
The
Getopt::Longdocumentation suggests a configuration option that might help:Once the regular options are parsed, you could use code such as that provided by runrig to parse the ad hoc options.