develooper Front page | perl.perl5.porters | Postings from March 2013

Re: [perl #84680] POSIX::isdigit() returns 1 for the empty string

Thread Previous | Thread Next
From:
Mark Overmeer
Date:
March 25, 2013 21:12
Subject:
Re: [perl #84680] POSIX::isdigit() returns 1 for the empty string
Message ID:
20130325211154.GA17193@moon.overmeer.net
* Frank Meyers via RT (perlbug-comment@perl.org) [130325 19:26]:
> $ python -c 'print "".isdigit()'
> False
> $ php -r 'var_dump(ctype_digit(""));'
> bool(false)
> $ perl -MPOSIX -e 'print isdigit(""), "\n"'
> 1
> $ 
> 
> WTF?

Yes, the documentation is flawed in many ways.  New documentation
is waiting for acceptance.

The actual implementations is: "true if all bytes are digits in
ASCII".  Useless function, and true with zero characters.
-- 
Regards,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark@Overmeer.net                          solutions@overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net


Thread Previous | Thread Next


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