Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Re: Getting readable results from Net::SNMP get_table method

by Ovid (Cardinal)
on May 16, 2001 at 03:52 UTC ( [id://80754]=note: print w/replies, xml ) Need Help??


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

Close, but here's what you actually want.
print "$result->{$_}\n" for keys %$result;

Cheers,
Ovid

Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.

Replies are listed 'Best First'.
Re: Re: Re: Getting readable results from Net::SNMP get_table method
by fingers (Acolyte) on May 16, 2001 at 04:29 UTC
    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?
      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'}

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-03-28 23:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found