The latest official release of CPAN.pm, version 1.9205, contains a null byte in its source file.
I am somewhat surprised that perl doesn't trip over it, as there have been far more innocuous things that have made it stumble in the past, like line endings of another platform (Mac/Unix).
In case you're wondering: it's in sub CPAN::Shell::recent, at the start of the line with contents (that appear in the source only once):
$desc =~ s/.+? - //;
NUL
bytes are perfectly legal inside Perl programs. The core uses them in a couple of places when creating code snippets to pass back to the interpreter, particularly as the quote character for q
, as it's the only character that a C
string can't contain. (Search for the string %c%s%c
in perl.c)
Re:NUL bytes are a hacker's friend
bart on 2008-03-05T09:41:58
Wow, that's... dirty.
Re:use.perl is not a bug tracker
jdavidb on 2008-03-07T14:30:16
It makes a great place to discuss things, though, and find out if they are really bugs or not.
Re:use.perl is not a bug tracker
bart on 2008-03-09T17:21:26
Exactly. I'm posting here to see:
- to see if I can state my case, and
- to check if I even have a case.