in reply to Re: making dumper to align perfectly
in thread making dumper to align perfectly

There is an improvement in the alignment, but i dont know how to get as i expected. It gives this output,
My hash-> $VAR1 = { 'a' => '1', 'b' => [ 1, 2 ] };
But i would want, ( as said in the previous reply ).

Replies are listed 'Best First'.
Re^3: making dumper to align perfectly
by moritz (Cardinal) on Oct 14, 2009 at 13:35 UTC
    Then you need to insert more spaces. It's not hard to get from my suggestion to what you want. Show some effort.
    Perl 6 - links to (nearly) everything that is Perl 6.
Re^3: making dumper to align perfectly
by grizzley (Chaplain) on Oct 14, 2009 at 13:37 UTC
    You just don't bother trying to adapt solutions given to you.
    my $d = Dumper $hash; my $somanyspaces = ' 'x10; # how long is your string? # add to all lines whitespaces $d =~ s/^/$somanyspaces/gm; # add to first line your string $d =~ s/^$somanyspaces/I am lazy /; print $d; # now indented