Bug#615149: Data::Dumper: mention how to control indentation length

jidanni at jidanni.org jidanni at jidanni.org
Sat Feb 26 03:14:36 UTC 2011


X-debbugs-Cc: gsar at activestate.com
Package: perl-doc
Version: 5.10.1-17
Severity: wishlist
File: /usr/share/man/man3/Data::Dumper.3perl.gz

No mention is made of how to control the number of spaces each line is
indented by.

       o   $Data::Dumper::Indent  or  $OBJ->Indent([NEWVAL])

           Controls the style of indentation.  It can be set to 0, 1, 2 or 3...

Style, but not actual number of blanks per each level of indentation.

So one ends up using crude hacks like
sed 's/  / /g;s/  / /g;s/  / /g'
to adjust the output.

Also allow the user to set a string for one indentation level, e.g., "\t"
or " " etc. if he prefers.






More information about the Perl-maintainers mailing list