Simple question:
use warnings;
use XML::Simple;
use Data::Dumper;
my $file='test.osm';
my $test_data = XMLin( $file );
print Dumper( $test_data );
my @way_node_refs=$test_data->{'way'}->{'nd'};
print Dumper( @way_node_refs );
print( @way_node_refs[1]->{'ref'} );ere
It has the following output. The first dump is not given because it does not matter.
$VAR1 = [
{
'ref' => '453966480'
},
{
'ref' => '453966490'
},
{
'ref' => '453966482'
},
{
'ref' => '453966130'
},
{
'ref' => '453966143'
},
{
'ref' => '453966480'
}
];
How can I access the values with the key ref. I don't know how to interprete the braces kinda.