in reply to Re: Illegal octal digit error
in thread Illegal octal digit error
This is surprising given the description of '=>' in perlop:
The "=>" operator is a synonym for the comma, but forces any word (consisting entirely of word characters) to its left to be interpreted as a string (as of 5.001). This includes words that might otherwise be considered a constant or function call.
And perlre defines a word character (\w) as:
A "\w" matches a single alphanumeric character (an alphabetic character, or a decimal digit) or "_"
Yet any collection of word characters that can be interpreted as a numeric constant is, and the result stringified. This includes octal, hex and some scientific notation (without period: e.g. 12e3).
Am I misreading perlsyn or does it say that 07, 0666, 0x123 and 12e3 or even 08, 0abc or even 0xyz should all be forced to be interpreted as strings rather than being interpreted as numbers or compile time errors?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Illegal octal digit error
by GrandFather (Saint) on Jun 06, 2009 at 12:51 UTC | |
by ig (Vicar) on Jun 06, 2009 at 12:59 UTC | |
|
Re^3: Illegal octal digit error
by ikegami (Patriarch) on Jun 06, 2009 at 18:08 UTC | |
by tye (Sage) on Jun 08, 2009 at 18:26 UTC | |
by ikegami (Patriarch) on Jun 08, 2009 at 19:13 UTC | |
by druud (Sexton) on Jun 08, 2009 at 18:03 UTC | |
|
Re^3: Illegal octal digit error
by JavaFan (Canon) on Jun 06, 2009 at 16:51 UTC |