You can (safely i think) clean the Data::Dumper output with regex's .. this is pretty close to what you want (might be easier though to split $s into an @lines array so that the first and last lines weren't touched by the substitutions...) :
use Data::Dumper;
use strict;
use warnings;
my $hoa = {a => [1,2], 'b'=>[1,3], c=> [2,0]};
my $s = Dumper $hoa;
$s =~ s/^\s+//mg;
$s =~ s/(?<!(\],| {))[\r\n]//sg;
print $s; print "\n";