# New Ticket Created by Aleks-Daniel Jakimenko-Aleksejev
# Please include the string: [perl #131923]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=131923 >
Most command line tools support zero-separated input and output (grep -z, find
-print0, perl -0, sort -z, xargs -0, sed -z).
And while you can use .stdout.lines to work on things line-by-line, doing the
same thing with null-byte separators is significantly harder.
<jnthn> Anyway, it's pretty easy to write yourself
<jnthn> Something like
<jnthn> supply { my $buffer = ''; whenever $stdout { $buffer ~= $_; while
$buffer.index("\0") -> $idx { emit $buffer.substr(0, $idx); $buffer .=
substr($idx + 1); } LAST emit $buffer } }
I agree that it is not too hard, but it should be built in.
One could argue that it should be *easier* to do this than to work on stuff
line-by-line. People usually don't expect newlines in filenames, but it is
legal and therefore any code that expects non-null separated paths is broken.
Not sure if we should go so far in trying to get the huffman coding right, but
a built-in way to work with data like this would be a great step.