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.
In reply to Re: How to use getopt and $#argv together?
by ikegami
in thread How to use getopt and $#argv together?
by iphone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |