in reply to Re: dynamic hash name
in thread dynamic hash name

So for the first option: How do I iterate? Because at the end this is what I want to do.
for my $key ( keys %citystate ) { $fhdest -> print("<p>$key</p>"); } for my $key ( keys %citycountry ) { $fhdest -> print("<p>$key</p>"); } for my $key ( keys %airportCode ) { $fhdest -> print("<p>$key</p>"); }

Replies are listed 'Best First'.
Re^3: dynamic hash name
by ikegami (Patriarch) on Feb 03, 2009 at 01:34 UTC
    $data{citystate} contains a reference to a hash, so where you had
    for my $key ( keys %citystate ) {
    you now use
    for my $key ( keys %{ $data{citystate} } ) {