in reply to Using perl switch with getopts.

Just use Getopt::Long, or any of the many Getopt:: modules