Is this bug in Getopt::Std?
am 20.10.2006 21:00:55 von Hemant ShahFolks,
Here is the sample perl script:
#!/usr/bin/perl
use Getopt::Std;
my %Options;
getopts('C:', \%Options);
print "Comment = $Options{C}\n";
print "ARGV[0] = $ARGV[0]\n" if ($ARGV[0]);
When I run the script as follows:
../tstgetopts.pl -a"Comment"
Unknown option: a
Comment = omment
Why does getopts set value for $Options{C}?
It should be a left in %ARGV.
If I use space in between then it works as expected.
../tstgetopts.pl -a "Comment"
Unknown option: a
Comment =
ARGV[0] = Comment
Is this a bug or am I missing something?
--
Hemant Shah /"\ ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com \ / ---------------------
X against HTML mail
TO REPLY, REMOVE NoJunkMail / \ and postings
FROM MY E-MAIL ADDRESS.
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.