in reply to Re: Is there a way to reduce Data::Dumper's output size?
in thread Is there a way to reduce Data::Dumper's output size?

$dumper_output =~ s/ +/ /g;

Probably not a good idea...

use Data::Dumper; my $dumper_output = Dumper({"foo bar"=>"quz\n baz"}); print $dumper_output; $dumper_output =~ s/ +/ /g; print $dumper_output; __END__ $VAR1 = { 'foo bar' => 'quz baz' }; $VAR1 = { 'foo bar' => 'quz baz' };

Replies are listed 'Best First'.
Re^3: Is there a way to reduce Data::Dumper's output size?
by Laurent_R (Canon) on Feb 10, 2015 at 22:49 UTC
    Ooops, yes, you are quite right, I did not think of the cases where keys or values might have multiple spaces. This would usually not happen where I work (because we usually normalize keys and values), but, yes, there is a danger of messing things up. Thank you for for the comment.

    Je suis Charlie.