M
mhubbard
Hello all,
I have been able to get several examples of XML::Simple working, but
this one thing keeps tripping me up. Here are the results of
print Dumper($XMLRef):
$VAR1 = {
'lastChangeCaptured' => {
'value' => 'Dec 31, 1969 6:00:00 PM'
},
'backupEnabled' => {
'value' => 'true'
},
'model' => {
'value' => 'Catalyst Switch with CatIOS'
},
'startupRunningSynchronized' => {
'value' => 'Not Applicable'
},
'lastReboot' => {
'value' => 'Dec 31, 1969 6:00:00 PM'
},
'hostname' => {
'value' => 'Cisco 2924A'
},
'xmlns:xlink' => 'http://www.w3.org/1999/xlink',
'comments' => {
'value' => ''
},
'backupStatus' => {
'value' => 'BACK_UP_FAILED'
},
'city' => {
'value' => ''
},
'assetId' => {
'value' => ''
},
'flashMemory' => {
'value' => ''
},
'id' => {
'value' =>
'dd8bca809f8ac174:45febfc9:10907635a57:-7eba'
},
'xmlns:sdk' => 'urn:sdk.company.com',
'administrativeIp' => {
'value' => '10.100.1.12'
},
};
Here is my code:
$response = $browser->get($URL);
if(!($response->is_success)){
print "FAILED _getDeviceByIP - Unable to get device\n";
}else{
my $XML = $response->content;
my $deviceXML = XMLin($XML, forcearray=>1);
When I try to access $deviceXML->{administrativeIp}, I get
HASH(0x2228754).
I have been able to get several examples of XML::Simple working, but
this one thing keeps tripping me up. Here are the results of
print Dumper($XMLRef):
$VAR1 = {
'lastChangeCaptured' => {
'value' => 'Dec 31, 1969 6:00:00 PM'
},
'backupEnabled' => {
'value' => 'true'
},
'model' => {
'value' => 'Catalyst Switch with CatIOS'
},
'startupRunningSynchronized' => {
'value' => 'Not Applicable'
},
'lastReboot' => {
'value' => 'Dec 31, 1969 6:00:00 PM'
},
'hostname' => {
'value' => 'Cisco 2924A'
},
'xmlns:xlink' => 'http://www.w3.org/1999/xlink',
'comments' => {
'value' => ''
},
'backupStatus' => {
'value' => 'BACK_UP_FAILED'
},
'city' => {
'value' => ''
},
'assetId' => {
'value' => ''
},
'flashMemory' => {
'value' => ''
},
'id' => {
'value' =>
'dd8bca809f8ac174:45febfc9:10907635a57:-7eba'
},
'xmlns:sdk' => 'urn:sdk.company.com',
'administrativeIp' => {
'value' => '10.100.1.12'
},
};
Here is my code:
$response = $browser->get($URL);
if(!($response->is_success)){
print "FAILED _getDeviceByIP - Unable to get device\n";
}else{
my $XML = $response->content;
my $deviceXML = XMLin($XML, forcearray=>1);
When I try to access $deviceXML->{administrativeIp}, I get
HASH(0x2228754).