in reply to Using number "0" as an input argument
I guess you want something like this:
#!/usr/bin/env perl use strict; use warnings; use Getopt::Long; use Pod::Usage; use Data::Dump; my %options; # Getopt::Long::Configure("no_ignore_case"); # perhaps you need it... GetOptions( \%options, "device=i" ); pod2usage( -exitstatus => 0, -verbose => 2 ) unless defined $options{d +evice}; dd \%options; # stuff... __END__ =pod =head1 USAGE Something went wrong. =cut
Please see also Re: throw a warning if no argument were passed, Re: GetOpt Organization and Getopt::Long
Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
In Section
Seekers of Perl Wisdom