in reply to Use of Data::Dumper
print Dumper(\%usage);
than to use a loop:
for (keys %usage) { print "$_ = $usage{$_}\n" }
The real power is if you have a more complicated data structure, such as a hash-of-arrays, a hash-of-hashes, or any arbitrarily deep structure (see perldsc). You don't need to know what the structure is: Dumper figures it out for you. There is no need for nesting loops just to print out the contents.
This is just one usage of the module (the one that your code uses). There are many more purposes and features which you can read about in Data::Dumper.
|
|---|