Data::Dumper not indenting per perldocs



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)

.



Relevant Pages

  • Re: bit sequence match
    ... > Are the hash keys really going to be numeric? ... I'm guessing it's a plain numeric sort. ... therefore it would be array of hash refs ...
    (comp.lang.perl.misc)
  • Re: Newbea question again?
    ... I have a array and hash. ... compare array elements with hash keys. ... my question here is that how can I compare array with hash keys and how ... can I can send warning message to user? ...
    (comp.lang.ruby)
  • Re: bit sequence match
    ... :> Edo wrote: ... :> Are the hash keys really going to be numeric? ... %h3 which I think it could be an array @a3 instead, ...
    (comp.lang.perl.misc)
  • Re: hask key
    ... I am collecting hash keys via http request as string. ... you could just use the string itself as the hash key. ... that is internal to the INTERN process* and then your explicit one. ...
    (comp.lang.lisp)
  • Re: Ordered hashes
    ... no problem to sort the entries alphabetically by their hash keys each ... Yes, formally speaking it is, but practically speaking I do not use it as ... access the name and the choices individually, like with a hash. ... anonymous arrays within?). ...
    (comp.lang.perl.misc)