in reply to A philosophical pondering concerning hexes
Of course, as pointed out, your fallacy lies in assuming that oct and hex return decimal representations of numbers - they don't. They return numbers:
It's a number - without a stringified valued.$ perl -MDevel::Peek -wle 'Dump hex 10' SV = IV(0x8192014) at 0x8181270 REFCNT = 1 FLAGS = (IOK,READONLY,pIOK) IV = 16
Also, Perl already has a function to turn a number into a hexadecimal, octal or binary representation: it's called sprintf.
Abigail
|
---|