4

For Data::Dumper, we have options for indentation:

$Data::Dumper::Indent = 1;

I don't prefer 2 or 3. In option 1, it was 2 whitespace added. Can I change?

Christopher Bottoms
  • 11,218
  • 8
  • 50
  • 99
  • 2
    It sounds like you're using Data::Dumper as more than a debugging aid. I recommend against that. If you're using it for data storage, JSON and YAML are far better choices. – ikegami Nov 14 '19 at 00:59
  • For debugging, perhaps try [Data::Show](https://metacpan.org/pod/Data::Show)? – Christopher Bottoms Feb 13 '20 at 13:18
  • If you are trying to store data and aren't ready to try ikegami's suggestion of using JSON or YAML, you might want to check out [Data::Dump](https://metacpan.org/pod/Data::Dump). But, JSON is very nice and more universal, in the sense that there are parsers for it in many languages, making it easier to share data with other people (or libraries, etc). – Christopher Bottoms Feb 13 '20 at 13:29

1 Answers1

4

No. $Data::Dumper::Indent and $Data::Dumper::Terse are the only means of controlling the indenting.

ikegami
  • 367,544
  • 15
  • 269
  • 518