I'm using Getopts::Std to parse command line parameters. The -n flag needs to take a numeric value. The relevant bits of code are
Firstly, why doesn't this work? And secondly, there must be a better check for $opts{'n'} being numeric. All suggestions welcome.
Thanks
Ceci n'est pas une signature
Columb Healy
Code:
my %opts;
getopts 'lfh:?tm:n:', \%opts or print_usage;
defined $opts{'?'} and print_usage;
( defined $opts{'n'} ) && ( ! $opts{'n'} =~ /^\d+$/ ) and print_usage;
Thanks
Ceci n'est pas une signature
Columb Healy