in reply to prettyfy hashes

#! perl -sw use strict; use List::Util qw[ max ]; my $first = <>; my @ugly = <>; my $last = pop @ugly; my @bits = map[ m[(^\s+)(\S+)\s*=>\s*(\S+),\n] ], @ugly; my $largest = max( map{ length( $_->[1] ) } @bits ); print $first; printf "%s%-${largest}s => %s,\n", @$_ for @bits; print $last;

Output:

C:\test>1159396 C:\test>1159396 %some_hash = ( key => "value1", larger_key => "value2", even_larger_key => "value3", ); ^Z %some_hash = ( key => "value1", larger_key => "value2", even_larger_key => "value3", );

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice.