in reply to Range in Getopt
Another way (stealing james2vegas's die message):
use warnings; use strict; use Getopt::Long; my $_debug = 1; # or whatever default you want it to be GetOptions('d=i' => \$_debug) or die("Invalid commmand line options.") +; die "Invalid Debug Level ($_debug)" if $_debug<1 or $_debug>4; print "\$_debug = $_debug\n";
|
---|
In Section
Seekers of Perl Wisdom