use warnings; use strict; use B 'hash'; use Inline C => <<'_C_'; U32 myhash(SV* sv) { STRLEN len; U32 hash = 0; const char *s = SvPVbyte(sv, len); PERL_HASH(hash, s, len); return hash; } _C_ print hash("foo"), "\n"; printf "%#x\n", myhash("foo"); __END__ 0x6611676e 0x6611676e