hex(substr($hex, -8)) & $integer; # Perl with 32-bit integers hex(substr($hex, -16)) & $integer; # Perl with 64-bit integers