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

wil's scratchpad

by wil (Priest)
on Jun 04, 2004 at 10:49 UTC ( #360803=scratchpad: print w/ replies, xml ) Need Help??

I can access a few elements through
$var->{head}->{foo}
quite easy, but how do I access the looped info in
$var->{dayf}
?

As in, how I loop over all three sections within 'dayf' so I can essentially output
$var->{dayf}->{day}->(first one in loop)->{part}->{icon}
?
$var = {
          'head' => {
                      'foo' => 'bar',
                    },
          'dayf' => {
                      'day' => [
                                 {
                                   'hi' => '14',
                                   'suns' => '9:01 PM',
                                   'dt' => 'May 12',
                                   'part' => 
                                               {
                                                 'hmid' => '57',
                                                 'wind' => {
                                                             'gust' => 'N/A',
                                                             'd' => '103',
                                                             's' => '21',
                                                             't' => 'ESE'
                                                           },
                                                 'icon' => '39',
                                                 'p' => 'd',
                                                 'ppcp' => '30',
                                                 'bt' => 'AM Showers',
                                                 't' => 'AM Showers'
                                               },
                                               {
                                                 'hmid' => '66',
                                                 'wind' => {
                                                             'gust' => 'N/A',
                                                             'd' => '89',
                                                             's' => '27',
                                                             't' => 'E'
                                                           },
                                                 'icon' => '11',
                                                 'p' => 'n',
                                                 'ppcp' => '60',
                                                 'bt' => 'Showers',
                                                 't' => 'Showers'
                                               }
                                             ,
                                   'd' => '0',
                                   'sunr' => '5:26 AM',
                                   'low' => '6',
                                   't' => 'Thursday'
                                 },
                                 {
                                   'hi' => '13',
                                   'suns' => '9:03 PM',
                                   'dt' => 'May 13',
                                   'part' => 
                                               {
                                                 'hmid' => '60',
                                                 'wind' => {
                                                             'gust' => 'N/A',
                                                             'd' => '75',
                                                             's' => '34',
                                                             't' => 'ENE'
                                                           },
                                                 'icon' => '11',
                                                 'p' => 'd',
                                                 'ppcp' => '30',
                                                 'bt' => 'Showers/Wind',
                                                 't' => 'Few Showers / Wind'
                                               },
                                               {
                                                 'hmid' => '77',
                                                 'wind' => {
                                                             'gust' => 'N/A',
                                                             'd' => '79',
                                                             's' => '34',
                                                             't' => 'E'
                                                           },
                                                 'icon' => '11',
                                                 'p' => 'n',
                                                 'ppcp' => '90',
                                                 'bt' => 'Light Rain',
                                                 't' => 'Light Rain / Wind'
                                               }
                                             ,
                                   'd' => '1',
                                   'sunr' => '5:24 AM',
                                   'low' => '7',
                                   't' => 'Friday'
                                 },
                                 {
                                   'hi' => '11',
                                   'suns' => '9:04 PM',
                                   'dt' => 'May 14',
                                   'part' => 
                                               {
                                                 'hmid' => '80',
                                                 'wind' => {
                                                             'gust' => 'N/A',
                                                             'd' => '80',
                                                             's' => '27',
                                                             't' => 'E'
                                                           },
                                                 'icon' => '11',
                                                 'p' => 'd',
                                                 'ppcp' => '40',
                                                 'bt' => 'Showers',
                                                 't' => 'Showers'
                                               },
                                               {
                                                 'hmid' => '83',
                                                 'wind' => {
                                                             'gust' => 'N/A',
                                                             'd' => '84',
                                                             's' => '18',
                                                             't' => 'E'
                                                           },
                                                 'icon' => '11',
                                                 'p' => 'n',
                                                 'ppcp' => '60',
                                                 'bt' => 'Light Rain',
                                                 't' => 'Light Rain'
                                               }
                                             ,
                                   'd' => '2',
                                   'sunr' => '5:22 AM',
                                   'low' => '6',
                                   't' => 'Saturday'
                                 }
                               ],
                      'cached' => 1115886744
                    },
          'cc' => {
                    'foo' => 'bar',
                  },
          'loc' => {
                     'foo' => 'bar',
                   }
        };
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2014-10-25 21:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (149 votes), past polls