in reply to hex numbers

To convert from the hex representation to a number, simply use hex.
my $num = hex($hex);