in reply to Parsing options with Getopt & Dispatch Table

Getopt::Std::getopt simply fills the %opt hash with keys d, h or p (setting values to 1). You then delete all the values of the hash by your second "%opts =" assignment.

For example, using the -d switch on your command line fills the hash with the following after the getopt call:

$VAR1 = { 'd' => 1 };
You then overwrite the hash entirely.

I don't think Getopt::Std works the way you want it to. Perhaps Getopt::Long does (User defined subroutines to handle options).