What am I doing wrong here???<br><br>I want to have an octet string that uses nulls to delimit fields,<br>and then the receiver should be able to 'split' on nulls to<br>restore the original array.<br><br>Empty strings in the middle of the array are preserved, but <br>
empty strings at the end of the array are not.<br><br>I need them all to be preserved!<br>What am I missing?<br><br>TIA<br>Fulko<br><br><br>#!/usr/bin/perl<br><br>use Data::Dumper;<br><br>my @x = ( 'a', 'b', 'c', ' ', 'd', '', '' );<br>
my $f = join ("\x00", @x);<br>print Dumper(@x);<br>print unpack ('H*', $f), "\n\n";<br><br>@r = split ("\x00", $f);<br><br>print Dumper(@r);<br><br><br>