in reply to Open and parsing a file with array of hashes!?

Another option?

use strict; use warnings; my $weather = do "weather.txt"; print $weather->[0]->{xml_api_reply}->{weather}->{forecast_information +}->{city}->{-data},$/; # prints Miami, FL

Replies are listed 'Best First'.
Re^2: Open and parsing a file with array of hashes!?
by Anonymous Monk on Aug 16, 2012 at 15:25 UTC
    Could it be in a loop in get all the city names?
      use strict; use warnings; my $weather = do "weather.txt"; print $_->{xml_api_reply}->{weather}->{forecast_information}->{city}-> +{-data},$/ for @$weather;

      Prints:

      Miami, FL Boston, MA