in reply to Getopt - Validate arguments before processing

One of my all-time favourite nodes, The Dynamic Duo --or-- Holy Getopt::Long, Pod::UsageMan!, shows how to do this with Getopt::Long, which is core. The line that does the job appears in the text and the full example, and is:

pod2usage(-verbose => 1) && exit if ($opt_debug !~ /^[01]$/);

Regards,

John Davies