G
Greg Scharlemann
I made a call to a given web server to translate a US address its
lat/lon position and I was returned a variable $result. When I do
print Dumper $result;
The following prints:
$VAR1 = [
bless( {
'number' => '1600',
'street' => 'Pennsylvania',
'lat' => '38.898748',
'state' => 'DC',
'city' => 'Washington',
'zip' => '20502',
'suffix' => 'NW',
'long' => '-77.037684',
'type' => 'Ave',
'prefix' => ''
}, 'GeocoderResult' )
];
My question: How do I access the elements within $result?
i.e.
print $result->{state}; #doesn't print anything
Thanks for your help
lat/lon position and I was returned a variable $result. When I do
print Dumper $result;
The following prints:
$VAR1 = [
bless( {
'number' => '1600',
'street' => 'Pennsylvania',
'lat' => '38.898748',
'state' => 'DC',
'city' => 'Washington',
'zip' => '20502',
'suffix' => 'NW',
'long' => '-77.037684',
'type' => 'Ave',
'prefix' => ''
}, 'GeocoderResult' )
];
My question: How do I access the elements within $result?
i.e.
print $result->{state}; #doesn't print anything
Thanks for your help