Here's how you go about printing hashes of arrays. This should be general enough that you can adapt it to your situation once you work through the syntax and other errors in your code that are dumped to your screen when you type perl -c scriptname.
Let's say you have a Hash of Arrays like this:
my %HOA = ( this => [ 'A', 'B', 'C' ], that => [ 'D', 'E', 'F' ], other => [ 'G', 'H', 'I' ], );
You could print a given element like this:
print $hoa{this}[2], "\n"; # prints 'C'.
...or you could print each row like this:
foreach my $key ( keys %HOA ) { print "$key:\t"; print "$_\t" for @{$HOA{$key}}; print "\n"; } # Prints the following (don't rely on the order of hash keys). # this: A B C # that: D E F # other: G H I
Helpful documentation: perlreftut, perlref, perllol, perldsc.
Dave
In reply to Re^5: Optional Arguments..?
by davido
in thread Optional Arguments..?
by Watergun
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |