#!/usr/bin/perl use strict; use Getopt::Long; $Getopt::Long::autoabbrev = 1; $Getopt::Long::ignorecase = 0; my ($opt_help, $opt_cfg, $opt_verbose, $opt_silent, $opt_dir); GetOptions( "help" => \$opt_help, "cfg=s" => \$opt_cfg, "verbose" => \$opt_verbose, "silent" => \$opt_silent, "dir=s" => \$opt_dir, ) or die "Mandatory options not supplied\n"; # How to find out which option is passed via Getopt. # I can rely on the variables for their definedness, but options might increase and # considerably. Is there any short way that I can find where all the options are stored # say in a hash.