http://qs321.pair.com?node_id=577523


in reply to Re: the repetition operator does not repeat "\x00" Why?
in thread the repetition operator does not repeat "\x00" Why?

Data::Dumper prints it for me (Perl 5.8.8, Solaris):
perl -MData::Dumper -e '$_ = "\x00" x 4; print Dumper $_' | cat -v $VAR1 = '^@^@^@^@';

Replies are listed 'Best First'.
Re^3: the repetition operator does not repeat "\x00" Why?
by Hofmator (Curate) on Oct 11, 2006 at 06:09 UTC
    You are correct, Data::Dumper prints the '\0' but it is only visible in the output via something like cat -v. Nice trick btw, I didn't know about that. Thank you!

    -- Hofmator

    Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.