Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: ' or no?

by Sartak (Hermit)
on Dec 28, 2006 at 03:40 UTC ( [id://591972] : note . print w/replies, xml ) Need Help??


in reply to Re: ' or no?
in thread ' or no?

In other words, a bare 0xFF is converted to 255 by the parser before oct ever sees it. (I'm not sure if this conversion actually happens, but intuitively that's what's happening)

Replies are listed 'Best First'.
Re^3: ' or no?
by ikegami (Patriarch) on Dec 28, 2006 at 04:06 UTC

    I'm not sure if this conversion actually happens

    Yes, it does. A more precise wording of what happens is: "The Perl literal 0xFF is converted to the numerical value 255 by the parser before oct ever sees it."

    oct, requiring a string, converts the numerical value 255 to the string value 255. Doing it's job, oct then converts the string value 255 to the numerical value 173.