and basically I am having trouble forcing the incident into an array so I can call it like this:$VAR1 = { 'incident-report' => [ { 'incident' => { 'GDOT-INC-260089' => { 'location' => { 'link' => { 'direction' => 'South', 'hwy' => '2', 'content' => 'Southbound I-75 at DELK ROAD', 'name' => 'I-75', 'id' => '2078', 'mile-post' => '261.66' }, 'coord' => { 'y' => '435177', 'unit' => 'meters', 'x' => '670359', 'datum' => 'NAD83', 'projection' => 'GA State Plane West' }, 'county' => { 'content' => 'Cobb', 'id' => '67' }, 'type' => { 'content' => 'Freeway', 'id' => '1' }, 'description' => 'Southbound I-75 at Delk Road' }, 'status' => 'active', 'description' => 'Medium impact, 1 tractor-trailer, Cobb Co.', 'lanes' => '2 Right Lanes', 'level' => '3', 'type' => { 'content' => 'Accident', 'id' => '1' }, 'cleanup' => { 'timestamp' => '2003-06-19 17:20:00 EDT', 'content' => ' 5:20 PM Today' }, 'impact' => { 'content' => 'Medium', 'id' => '2' } },
It gives me the error about not being a valid array. Can anyone suggest something that might work to get that 'GDOT-INC-260089' part into an array so that I can loop through them? I want to share the code for this when I get it finished. Maybe someone in Georgia will be able to use it ;-)print $ref->{incident}->[0]->{location}->{county}->{content} . "\n";
2003-06-21 edit ybiC: two-space indents, quasi-vertical alignment of comma-arrows for legibility
In reply to XML::Simple parsing :-( by st4k
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |