kulls has asked for the wisdom of the Perl Monks concerning the following question:
Is there any way to show the data in a tabular format without using "\n\t"?. How can i handle the alignments while displaying values ? Is there any perl function that will sum all the values in a hash? Thanx in advance -kulls%dir_file_counts = ( xbags => 416, apr => 28, apam => 1, asrs => 431, aast => 181, xpept => 8, xbank => 178, aprot => 28 ); print "\n Total Number of files \n\n"; foreach(keys %dir_file_counts) { print "\n \t $_ => ".$dir_file_counts{$_}; } __PRINT___ Total Number of files xbags => 416 apr => 28 apam => 1 asrs => 431 aast => 181 xpept => 8 xbank => 178 aprot => 28
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Add and print the values in a hash
by McDarren (Abbot) on Jan 31, 2006 at 09:20 UTC | |
by strat (Canon) on Jan 31, 2006 at 09:30 UTC | |
|
Re: Add and print the values in a hash
by xdg (Monsignor) on Jan 31, 2006 at 11:48 UTC |