My guess is that he means something like:
$ perl -wle 'print oct 108'
Illegal octal digit '8' ignored at -e line 1.
8
To me, this is just what's Perl is about; regardless of what you throw at it, it does it utter best to make something out of it, and it issues a warning there's something odd about the input. Although in this case, it isn't just Perl that does so - the C functions strtol, and atoi and friends also consume initial portions of a string, stopping at the first character that isn't valid.
Abigail | [reply] [d/l] |
No, I didn't give oct a valid hex number, I gave it an invalid octal number which could have been understood as an otherwise valid decimal number. I had not previously considered that oct() would consume a hex number but since it is implemented using a function shared with hex, I suppose that makes sense.
perl -wle 'print oct "108"'
Illegal octal digit '8' ignored at -e line 1.
8
| [reply] [d/l] |
| [reply] |