In Perl 5 ASCII 0 bytes are valid in source code. As they're not identifier
characters [ :-) ] this means that they're valid as quoting characters for
things like q{}. Although they can't be stored inside C strings, the
Perl 5 tokeniser has no problem with them. This makes them rather useful,
as they can be used as delimiters around snippets of code generated
inside the compiler, where the snippet came in as a C string, as you can
guarantee that they won't appear *in the middle* of your snippet, so you
don't need to faff with parsing it and quoting a delimiter string.
Rafael used them to solve a bug when patch names had perl code in them:
http://public.activestate.com/cgi-bin/perlbrowse?patch=22850
and I've just used them to eliminate a lot of parsing and quoting code in
the Perl 5 tokeniser where it converts the -F flag to perl code:
http://public.activestate.com/cgi-bin/perlbrowse?patch=23727
I'm assuming that the insides of the Perl 6 compiler are going to be
equally agnostic of ASCII 0 bytes.
Nicholas Clark
Yes, I would expect so, although I hadn't thought of using ASCII 0 as
quoting characters -- that's a neat trick. I'll keep it in mind as we
progress. :-)
Pm