# New Ticket Created by  Zefram 
# Please include the string:  [perl #128545]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=128545 >


> Date.new("2016-07\x[308]-05").perl
Cannot convert string to number: trailing characters after number in '0^7?' 
(indicated by ^)
  in block <unit> at <unknown file> line 1

It is quite correct that this should error, but the error message isn't
as good as the one elicited by using a more mundane non-digit:

> Date.new("2016-0z-05").perl
Invalid Date string '2016-0z-05'; use yyyy-mm-dd instead
  in block <unit> at <unknown file> line 1

Obviously this happens because the digit with the diacritic matches /\d/,
so Date.new thinks it's a digit that it can use, but the subsequent
coercion doesn't actually accept it.  Either Date.new's syntax checking
needs to get stricter or its coercion needs to get more permissive.

-zefram

Reply via email to