in reply to Hex to decimal

You can try a sprintf ie.
$num = "AA"; $dec_num = sprintf("%d", hex($num)); print "$dec_num\n";