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

Re: Pre-RFC: builtin:: functions for detecting numbers vs strings

Thread Previous | Thread Next
From:
William Lindley
Date:
March 11, 2022 21:19
Subject:
Re: Pre-RFC: builtin:: functions for detecting numbers vs strings
Message ID:
1f33758e-8a1c-de18-86bc-59c0b455a719@wlindley.com
In all this discussion, what happens when reading a file containing the 
line:

01730

which is the postal code for my hometown.  This "looks like" a number 
but if treated like one, the leading zero is liable be dropped, leaving 
invalid postcode

1730

In more-pathological cases, 01730 could be interpreted as an octal 
number (984 decimal).

It is disheartening that Perl's "be forgiving in what you accept; be 
strict at what you output" is violated by so many newer protocols.


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