in reply to iterating a hash of (complex?) arrays
Is this about what you're looking for?
Caution: Contents may have been coded under pressure.
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"; } }
Caution: Contents may have been coded under pressure.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: iterating a hash of (complex?) arrays
by tcf03 (Deacon) on Apr 27, 2005 at 04:02 UTC |
In Section
Seekers of Perl Wisdom