develooper Front page | perl.perl5.porters | Postings from October 2014

Re: [perl #122876] Serialization for keys and values broken

Thread Previous | Thread Next
From:
Ricardo Signes
Date:
October 2, 2014 14:09
Subject:
Re: [perl #122876] Serialization for keys and values broken
Message ID:
20141002140906.GA10747@cancer.codesimply.com
* Steffen Winkler <perlbug-followup@perl.org> [2014-10-01T08:39:21]
> perl -e 'use Data::Dumper; print Data::Dumper->new([{"aaa\x00bbb" => "ccc\x00ddd"}],['hash'])->Useperl(1)->Quotekeys(0)->Dump'
> 
> results in:
> 
> $hash = {
>           'aaabbb' => 'cccddd'
>         };

~$ perl -e 'use Data::Dumper; print Data::Dumper->new([{"aaa\x00bbb" =>
"ccc\x00ddd"}],['hash'])->Useperl(1)->Quotekeys(0)->Dump' | gcat -A
$hash = {$
          'aaa^@bbb' => 'ccc^@ddd'$
                  };$


So, the NUL is in fact there, but you dn't see it normally, because NULs are
invisible.  If you want \0 to appear, you should also ->Useqq(1)

I don't think this is a bug.  Have I missed something?

-- 
rjbs

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About