in reply to Need some help with Hashes and formatting
You might also take a look at the each function to fetch directly the key/value pairs.foreach my $key (keys %hash) { print "$key \t $hash{$key} \n"; }
Get into the habit of using directly hashes rather than going into the trouble of using intermediary arrays, that's the only way to ge used to hashes and really leverage on their power.
Edit: adding an example with the each function:
while ( my ($key, $value) = each %hash) { printf "%10s\t%10s\n", $key, $value; }
|
|---|