in reply to ARGV behaviour in getopts std

If @ARGV contains 6 members, what is the index of the last element?

I prefer to avoid $#array in most cases unless I'm really talking about array indices.

I'm not sure why Getopt::Std doesn't reduce @ARGV to an empty list, but that's because you haven't shown your usage line. Personally, I use Getopt::Long for almost everything.