in reply to Hash of Arrays - Sort over all array entries
#!/usr/bin/perl -l use strict; use warnings; no warnings qw /syntax/; my %HoA = ( simpsons => [qw /homer marge bart/], flintstones => [qw /fred barney/], jetsons => [qw /george jane elroy astro/], ); print for sort map {my $name = $_; map {"$_:$name"} @{$HoA {$name}}} k +eys %HoA;
Of course, whether this is 'easier' is in the eye of the beholder.
Abigail
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Hash of Arrays - Sort over all array entries
by knexus (Hermit) on Sep 09, 2003 at 22:32 UTC | |
by Abigail-II (Bishop) on Sep 09, 2003 at 22:36 UTC | |
by tye (Sage) on Sep 10, 2003 at 16:06 UTC |