in reply to How do I process many (conflicting) command line parameters?
Something like this might be an option:
#!/usr/bin/env perl use strict; use warnings; use Getopt::Long; use Data::Dump; my $action = shift; my %options; my %actions = ( nose => \&nose, cuke => \&cuke ); $actions{$action}->(); dd \%options; sub nose { GetOptions( \%options, "foo=s" ) } sub cuke { GetOptions( \%options, "bar=s" ) }
OK, very simplified to get the idea. See also Re: GetOpt Organization.
Update: In other words: Make your program behave like aptitude. At least a bit.
Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
|
|---|