Data::Dumper not indenting per perldocs
- From: usenet@xxxxxxxxxxxxxxx
- Date: 29 Jan 2007 18:35:20 -0800
According to perldoc Data::Dumper:
$Data::Dumper::Indent or $OBJ->Indent([NEWVAL])
Controls the style of indentation. It can be set to 0,
1, 2 or 3.... Style 2 (the default) outputs a very
readable form which takes into account the length of
hash keys (so the hash value lines up).
However, when I run this program:
#!/usr/bin/perl
use strict;
use warnings;
use Data::Dumper;
$Data::Dumper::Indent = 2; #no diff if I comment this out
my %hash = qw{ this_is_a_long_hash_key long
short_key, short };
print Dumper \%hash;
__END__
I do not observe that the hash values line up:
$VAR1 = {
'this_is_a_long_hash_key' => 'long',
'short_key,' => 'short'
};
Why are the values not aligned? Thanks!
(Perl 5.8.4 on AIX 5.3 in a plain tty)
.
- Follow-Ups:
- Re: Data::Dumper not indenting per perldocs
- From: Uri Guttman
- Re: Data::Dumper not indenting per perldocs
- Prev by Date: FAQ 2.11 Perl Books
- Next by Date: Re: Data::Dumper not indenting per perldocs
- Previous by thread: FAQ 2.11 Perl Books
- Next by thread: Re: Data::Dumper not indenting per perldocs
- Index(es):
Relevant Pages
|
|