use NetSNMP::OID; my $oid = new NetSNMP::OID('sysContact.0'); if ($oid < new NetSNMP::OID('ifTable')) { do_something(); } my @numarray = $oid->to_array(); # appending oids $oid = new NetSNMP::OID('.1.3'); $oid += ".6.1"; # -> .1.3.6.1 # appending index strings $oid2 = $oid + "\"wes\""; # -> .1.3.6.1.3.119.101.115 $oid3 = $oid + "\'wes\'"; # -> .1.3.6.1.119.101.115 $len = $oid3->length(); # -> 7 # retrieving indexes from an oid: $arrayref = $tableoid->get_indexes()
The standard logical expression operators (<, >, ==, ...) are overloaded such that lexographical comparisons may be done with them.
The + operator is overloaded to allow you to append stuff on to the end of a OID, like index segments of a table, for example.