[Chicago-talk] Hash Question

richard at rushlogistics.com richard at rushlogistics.com
Sat Oct 3 09:59:32 PDT 2015


I have a hash reference with that originates from a DBI fetch  $sth->fetchall_hashref('ID'); and has the following structure:

$VAR1 = {
          '12' => {
                    'opp_team' => 'Storm',
                    'GAME_ID' => '1',
                    'DATE_FORMAT(g.DATE,\'%m-%d-%y\')' => '09-04-15',
                    'NAME' => 'Strikeout',
                    'STATUS' => 'PNDG',
                    'ACC_TYPE_ID' => '11',
                    'ID' => '12',
                    'PERIOD' => '1',
                    'TIME_DENOM' => 'inning'
                  },
          '11' => {
                    'ID' => '11',
                    'ACC_TYPE_ID' => '11',
                    'TIME_DENOM' => 'inning',
                    'PERIOD' => '1',
                    'NAME' => 'Strikeout',
                    'DATE_FORMAT(g.DATE,\'%m-%d-%y\')' => '09-04-15',
                    'GAME_ID' => '1',
                    'opp_team' => 'Storm',
                    'STATUS' => 'PNDG'
                  }
        };

Is there a way to access one element in the hash reference? I am trying print "Opp Team: $logro_ref->{'opp_team'}\n"; with no success. 

Thanks


More information about the Chicago-talk mailing list