in reply to Requiring option values in Getopt::Long

Hmm, I tested the code of JavaFan last night and I thought it didn't work. I was wrong because it did work and I was probably too sleepy to test it out properly.

Anyway, thanks JavaFan and ikegami for the help.
  • Comment on Re: Requiring option values in Getopt::Long

Replies are listed 'Best First'.
Re^2: Requiring option values in Getopt::Long
by Anonymous Monk on Oct 08, 2010 at 21:46 UTC
    I've tried the sample script: #!/usr/local/bin/perl use Getopt::Long; my $option_test; my $result = GetOptions ( 'test=s' => \$option_test ); if (! $result) { die "Invalid option specifications"; } on two different platforms (OS X and Ubuntu, both perl 5.10) and in both cases Getopt is returning 1 (success) _even if_ the supposedly required parameter isn't provided. has this behavior in Getopt changed?