perlchild has asked for the wisdom of the Perl Monks concerning the following question:
However, the hrSWInstalledDate doesn't print correctly as you can see in the output below.#!c:\Perl\bin\perl use SNMP; my $s = new SNMP::Session(DestHost => 'localhost', Community => 'publ +ic', Version => '2'); # gets an snmp table and returns a hashref in $j my $j = $s->gettable('hrSWInstalledTable'); # This statement returns the number of keys in the hashref. $numOfKeys = scalar keys %$j; # print out all of the values in the table for($key = 1; $key <= $numOfKeys; $key++) { print "Key = $key - 'hrSWInstalledIndex' = $$j{$key}{'hrSWInstall +edIndex'}\n"; print "Key = $key - 'hrSWInstalledName' = $$j{$key}{'hrSWInstall +edName'}\n"; print "Key = $key - 'hrSWInstalledID' = $$j{$key}{'hrSWInstall +edID'}\n"; print "Key = $key - 'hrSWInstalledType' = $$j{$key}{'hrSWInstall +edType'}\n"; print "Key = $key - 'hrSWInstalledDate' = $$j{$key}{'hrSWInstall +edDate'}\n"; }
C:\perlprograms>perl snmp_test.pl
Key = 1 - 'hrSWInstalledIndex' = 1
Key = 1 - 'hrSWInstalledName' = Emaga4 Game Resources 1.0
Key = 1 - 'hrSWInstalledID' = zeroDotZero
Key = 1 - 'hrSWInstalledType' = 4
Key = 1 - 'hrSWInstalledDate' = ╓
►"
Key = 2 - 'hrSWInstalledIndex' = 2
Key = 2 - 'hrSWInstalledName' = 3DGPAi1 Game Resources 1.0
Key = 2 - 'hrSWInstalledID' = zeroDotZero
Key = 2 - 'hrSWInstalledType' = 4
Key = 2 - 'hrSWInstalledDate' = ╓
♥↕+*
|
|---|