in reply to Output numbers in hex

Actually, all you want is to keep your hex constant as a string.
$hex_num = "0xf4a"; print $hex_num;
When you are ready to use the hex number in any numerical calculations, don't forget to use the hex function.

Abigail