http://qs1969.pair.com?node_id=80760


in reply to Re: Re: Getting readable results from Net::SNMP get_table method
in thread Getting readable results from Net::SNMP get_table method

When I use
print "$result->{$_}\n" for keys %$result;
I get output that looks like
HASH(0x82a08e0)->(1.3.6.1.4.9.9.23.1.2.1.1.8.4.2)
when I use the Data::Dumper module you suggest I get results that look like.
'1.3.6.1.4.9.9.23.1.2.1.1.8.4.2' => 'WS-C6509'
I assume that the oid is the key and the WS-C6509 is the object in the hash.

How would I pull that all into hash that I would be able to manipulate?

Replies are listed 'Best First'.
Re: Re: Re: Re: Getting readable results from Net::SNMP get_table method
by mr.nick (Chaplain) on May 16, 2001 at 05:22 UTC
    You asked for the contents of OID 1.3.6.1.4.9.9.23.1.2.1.1.8.4.2 and got it back, 'WS-C6509'.

    That data is in a hash, $result. You would access the data ala

    $result->{'1.3.6.1.4.9.9.23.1.2.1.1.8.4.2'}