Here's the most simple solution I found... The power of perl :) :)
#!/usr/bin/perl use utf8; use Modern::Perl; use Data::Dumper; my $db = { '99155' => { 'PR' => [ 'state_name=Puerto Rico', 'county_names_all=Adjuntas|Utuado', ], 'AK' => [ 'state_name=Alaska', 'county_names_all=Ketchikan Gateway|Prince of + + Wales-Hyder', ], 'WA' => [ 'state_name=Washington', 'county_names_all=Pend Oreille|Spokane|Lincol + +n|Adams', 'comments=America/Los_Angeles' ] }, '26134' => { 'WV' => [ 'state_name=West Virginia', 'county_names_all=Wirt|Wood|Jackson|Ritchie| + +Calhoun', 'comments=America/New_York' ] } }; my %states = map { ((split /=/, $$_[0], 2)[1], 'hurray!') } map { values %$_ } values %$db; print "states are: ", (join "; ", sort, keys %states), "\n";
result is:
root@orion:/tmp# ./mytest.pl states are: West Virginia; Puerto Rico; Washington; Alaska
In reply to Re: Get all hash value into array
by leszekdubiel
in thread Get all hash value into array
by Magnolia25
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |