$s = pack "L", 0x03141593; # 4 byte string $p = pack "P", $s; # pointer printf "%08X\n", unpack "L", unpack "P4", $p;