$mib = 'someMibObject'; $vb = new SNMP::Varbind([$mib]); LOOP: while ( 1 ) { $var = $sess->getnext($vb); # Get the next instance. if ( $sess->{ErrorNum} ) { # There was an error. Print $sess->{ErrorStr}, then: last LOOP; } if ( $vb->tag ne $mib ) { # This happens when we've read past the end of this # MIB object. last LOOP; } # If we get here, we use $vb->iid or $var or both to do # something useful with the response. }