use Devel::Peek; my $v = "\x{00}"; # $v is a string with a NUL character Dump $v; __END__ SV = PV(0x100801c78) at 0x1008143e8 REFCNT = 1 FLAGS = (PADMY,POK,pPOK) PV = 0x100218910 "\0"\0 CUR = 1 LEN = 8