Dru has asked for the wisdom of the Perl Monks concerning the following question:
I need it to be sorted as such:APAC India Delhi APAC China Suzhou APAC Australia Sydney APAC Japan Tokyo EMEA SouthAfrica Johannesburg EMEA Russia Moscow APAC China Shanghai EMEA Germany Munich EMEA France Paris EMEA Italy Venice NLAM Argentina BuenosAires2 NLAM USA NYC NLAM Brazil San Paulo NLAM USA Austin EMEA Italy Rome NLAM USA Boston
Here is where I am extracting my hash and how I sort based on regionAPAC Australia Sydney APAC China Shanghai APAC China Suzhou APAC India Delhi APAC Japan Tokyo EMEA France Paris EMEA Germany Munich EMEA Italy Rome EMEA Italy Venice EMEA Russia Moscow EMEA SouthAfrica Johannesburg NLAM Argentina BuenosAires2 NLAM Brazil San Paulo NLAM USA Austin NLAM USA Boston NLAM USA NYC
sub print_stats{ my $subinput = $_[0]; for my $site1 (keys %siteInfo){ #Site has to be in correct region next unless ($siteInfo{$site1}{region} eq $subinput); print "$siteInfo{$site1}{region},$siteInfo{$site1}{country},$site1, $siteInfo{$site1}{totalDevices}, ,$siteInfo{$site1}{totalVulns}, $siteInfo{$site1}{totalS5s},"; } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Sort a Hash 3 Levels Deep
by GrandFather (Saint) on Dec 09, 2008 at 20:14 UTC | |
by Dru (Hermit) on Dec 10, 2008 at 17:43 UTC | |
Re: Sort a Hash 3 Levels Deep
by kennethk (Abbot) on Dec 09, 2008 at 18:11 UTC | |
Re: Sort a Hash 3 Levels Deep
by MidLifeXis (Monsignor) on Dec 09, 2008 at 18:29 UTC | |
Re: Sort a Hash 3 Levels Deep
by SuicideJunkie (Vicar) on Dec 09, 2008 at 18:08 UTC |