Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Open and parsing a file with array of hashes!?

by hbm (Hermit)
on Aug 16, 2012 at 15:08 UTC ( #987795=note: print w/ replies, xml ) Need Help??


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


Comment on Re: Open and parsing a file with array of hashes!?
Download Code
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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987795]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (16)
As of 2014-04-17 14:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (450 votes), past polls