in reply to Printing a int as hex

printf "%02x\n", $hash{$x};