kthelen has asked for the wisdom of the Perl Monks concerning the following question:
If run, you'll see what I'm dealing with - a hash which contains hashes, all of which have the same name (VAR1) but contain different data.use strict; use LWP; use XML::Simple; use Data::Dumper; my $var_lat = "45.96968"; my $var_lon = "-93.33434899999997"; my $ua = LWP::UserAgent->new; my $forecast_xml = $ua->request(HTTP::Request->new(GET => "http://fore +cast.weather.gov/MapClick.php?lat=$var_lat&lon=$var_lon&unit=0&lg=eng +lish&FcstType=dwml")); my $forecast_arr = XMLin($forecast_xml->content); foreach my $item (@{$forecast_arr->{'data'}->[0]->{'time-layout'}}) { print Dumper $item; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Nested hashes, non-unique names
by choroba (Cardinal) on Mar 17, 2014 at 15:08 UTC | |
by kthelen (Initiate) on Mar 17, 2014 at 15:12 UTC | |
by kthelen (Initiate) on Mar 19, 2014 at 14:14 UTC | |
by choroba (Cardinal) on Mar 19, 2014 at 14:24 UTC | |
by kthelen (Initiate) on Mar 19, 2014 at 14:38 UTC | |
|
Re: Nested hashes, non-unique names
by Jenda (Abbot) on Mar 18, 2014 at 09:55 UTC |