Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re: HASH error

by McA (Priest)
on Sep 13, 2013 at 06:52 UTC ( #1053851=note: print w/ replies, xml ) Need Help??

in reply to HASH error

Put a

print Dumper($ref), "\n";

before the line

foreach my $oid (values %{$ref->{OBJECT}}) {

and show us the output. You also have to put a

use Data::Dumper;

below the line

use JSON;


Comment on Re: HASH error
Select or Download Code
Replies are listed 'Best First'.
Re^2: HASH error
by Sententiosus (Initiate) on Sep 13, 2013 at 08:21 UTC

    thanks McA

    the Output

    $VAR1 = { 'OBJECT' => { 'PROPERTY' => [ { 'content' => 'error', 'name' => 'response-type' }, { 'content' => '1', 'name' => 'response-type-numer +ic' }, { 'content' => 'Unauthorized acc +ess requested', 'name' => 'response' }, { 'content' => '6', 'name' => 'return-code' } ], 'oid' => '1', 'name' => 'status', 'basetype' => 'status' } }; Not a HASH reference at ./ line 19.

      As I'm not the author of that program I can only guess. Please change the line:

      my $ref = XMLin($res->content, KeyAttr => "oid");

      to the following

      my $ref = XMLin($res->content, KeyAttr => "oid", ForceArray => [ 'OBJE +CT' ]);

      and give it a try.


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053851]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2015-11-28 12:23 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (741 votes), past polls