in reply to Error inside Getopt::Long

Shouldn't $RCfile, $fixtarget, and $midlopts be passed to GetOptions() as references?

If you want to allow unspecified options to not cause warnings/errors, use the 'pass_through' option on Getopt::Long::Configure(), but that will leave the unspecified options in @ARGV, so if you want to remove them from @ARGV, you could also use Getopt::Std like so:

# Configure here or with Getopt::Long::Configure() use Getopt::Long qw(:config pass_through); use Getopt::Std; my ($verbose, @linkfiles, $RCfile, $fixtarget, $midlopts); GetOptions ( 'help|?|h' => \&show_options, 'verbose!' => \$verbose, 'v' => \$verbose, 'L=s' => \@linkfiles, 'RC=s' => $RCfile, 'fixtarget!' => $fixtarget, 'midlopts=s' => $midlopts ) or die; # If you don't want '$opt_*' variables # springing into existence, supply a hashref to getopt. # Of course there's an ambiguity about whether # or not your 'bad' options are supposed to take an # argument, so there isn't really any perfect solution here. my %other_opts; getopt('', \%other_opts); print "ARGV: @ARGV\n";