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

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

Thread Previous
From:
Reuben Thomas
Date:
December 17, 2012 19:29
Subject:
Re: [perl #116098] Error in Getopt::Std documentation examples
Message ID:
CAOnWdognAi8xvQ7on4hr5jDJTby-0PNn9DUEN_diY+SEOi8YsQ@mail.gmail.com
On 16 December 2012 21:25, Dave Mitchell via RT
<perlbug-followup@perl.org>wrote:

> 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
getopt.

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.

-- 
http://rrt.sc3d.org

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About