Notice that you don't generally have to iterate through the index of an array. Note also that you were fetching an array ref into an array (@names). You need to dereference it, as I have done here.for my $label (sort keys %family) { my @names = @{$family{$label}}; print "$label\n"; for my $name (@names) { print ref($name) ? "\t@$name\n" : "\t$name\n"; } }
In reply to Re: iterating a hash of (complex?) arrays
by Roy Johnson
in thread iterating a hash of (complex?) arrays
by tcf03
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |