Subject: | Configure("no_getopt_compat") does not work |
Consider the following script:
use Test::More qw(no_plan);
#BEGIN { $ENV{POSIXLY_CORRECT}=1 }
use Getopt::Long;
Getopt::Long::Configure('no_getopt_compat');
@ARGV = ("+bla");
GetOptions()
or die;
is($ARGV[0], "+bla");
__END__
This script fails with:
Unknown option: bla
It makes no difference if the configuration option is set in the
use-line or seperately with a Configure call. The only way to set it is
by setting the POSIXLY_CORRECT env variable as early as possible.
It seems that the problem lies in a wrong value for $genprefix. This
variable is only set in ConfigDefault(), but not updated if
$getopt_compat is unset later in Configure().
Regards,
Slaven