in reply to printing hexadecimal without printf
"Calculating in hex" makes no sense. Hex is just a representation of a number, so it's only relevant when viewing the number. A hex string needs to a number in order to do calculations on it. (In the case of literals like 0x15, the Perl parser does that for you.) And a number needs to be converted to a string to display it on the console. (print converts numbers into a decimal strings. (s)printf '%X' converts numbers into a hex strings.)
|
|---|