in reply to Getopt::Long result issue

When Getopt::Long says "requires a value" what it says is that if blah occurs it must have a value, not that blah is required. If you run your script with -blah (no value given) you will see $result is undef.

I am afraid what you will have to do is check blah is set once you have eaten up the options.

use strict; use warnings; use Getopt::Long; { my $blah; my $result = GetOptions('blah=i' => \$blah); &usage unless $blah; print "result = $result\n"; print "blah = $blah\n"; } sub usage { print "$0: -blah=value\n" }

Cheers,
R.