in reply to How to use getopt and $#argv together?
I noticed that after using "getopt" at the start of the code reduces $#argv to "0"
It doesn't for me.
$ perl -MGetopt::Std -E'getopt(\%opts); say 1+$#ARGV;' -- -f a b c d 3 $ perl -MGetopt::Std -E'say Getopt::Std->VERSION' 1.06
I suspect that you misstated your problem, asking about the number of arguments or options when you meant to ask how to check what options were specified. We could be of better assistance if you told us what you are actually trying to do.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to use getopt and $#argv together?
by TomDLux (Vicar) on Mar 09, 2011 at 22:25 UTC | |
by ikegami (Patriarch) on Mar 09, 2011 at 23:15 UTC |