1#!./perl -w 2 3BEGIN { 4 if ($ENV{PERL_CORE}) { 5 @INC = '../lib'; 6 chdir 't'; 7 } 8} 9 10use Getopt::Long qw(:config no_ignore_case); 11die("Getopt::Long version 2.23_03 required--this is only version ". 12 $Getopt::Long::VERSION) 13 unless $Getopt::Long::VERSION ge "2.24"; 14 15print "1..9\n"; 16 17@ARGV = qw(-Foo -baR --foo bar); 18undef $opt_baR; 19undef $opt_bar; 20print "ok 1\n" if GetOptions ("foo", "Foo=s"); 21print ((defined $opt_foo) ? "" : "not ", "ok 2\n"); 22print (($opt_foo == 1) ? "" : "not ", "ok 3\n"); 23print ((defined $opt_Foo) ? "" : "not ", "ok 4\n"); 24print (($opt_Foo eq "-baR") ? "" : "not ", "ok 5\n"); 25print ((@ARGV == 1) ? "" : "not ", "ok 6\n"); 26print (($ARGV[0] eq "bar") ? "" : "not ", "ok 7\n"); 27print (!(defined $opt_baR) ? "" : "not ", "ok 8\n"); 28print (!(defined $opt_bar) ? "" : "not ", "ok 9\n"); 29