develooper Front page | perl.perl5.porters | Postings from December 2012

Re: [perl #116098] Error in Getopt::Std documentation examples

Thread Previous
Reuben Thomas
December 17, 2012 19:29
Re: [perl #116098] Error in Getopt::Std documentation examples
Message ID:
On 16 December 2012 21:25, Dave Mitchell via RT

> I think you have confused the optopt() function with the getopts()
> function.

I think you mean "getopt", not "optopt". Quite right! I switched from
getopt to getopts, and then wrote the bug report thinking I was still using

The former doesn't recognise ':', and assumes that every switch
> has an argument

Given that this is of little interest, maybe it's worth reordering the
documentation so that getopts is documented first? Then fewer programmers
will start using the obviously-named function, then discover that it has
this weird behaviour and switch to getopts.

Really, getopt should be deprecated.

(Interestingly enough, getopts() seems to treat the ':' both as an argument
> placeholder and an option!)

Surely that's a bug? It's not documented.


Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About