in reply to integer value to hex value
If you are taking 66778899 and converting it to 0x66778899 why not:
my $val = "0x" . $val; [download]