my $r = 0x234; my $t = 0x345; my $y = pack('L L', $t, $r); my $x1 = unpack('Q', $y); printf "\nThe value is 0x%x", $x1; # 0x23400000345