1N/A chdir 't' if -d 't'; 1N/A# First we test the getopt function 1N/Ais( "@ARGV", 'file', 'options removed from @ARGV (1)' );
1N/Ais( "@ARGV", 'k -- -l m -n', 'options removed from @ARGV (2)' );
1N/A# Then we try the getopts 1N/Aok( getopts('oif:'), 'getopts succeeded (1)' );
1N/Ais( "@ARGV", 'file', 'options removed from @ARGV (3)' );
1N/Aok( getopts('hi:kl', \%opt), 'getopts succeeded (2)' );
1N/Ais( "@ARGV", '-l m', 'options removed from @ARGV (4)' );
1N/A# Try illegal options, but avoid printing of the error message 1N/Aok( !getopts("xf:y"), 'getopts fails for an illegal option' ); 1N/A# Then try the Getopt::Long module 1N/A 'Getopt::Long::GetOptions succeeded' 1N/Ais( "@ARGV", 'file', 'options removed from @ARGV (5)' );