$mib = 'someMibObject'; $vb = SNMP::Varbind->new([$mib]); while ( $vb->tag eq $mib ) { $var = $sess->getnext($vb); # Get the next instance. last if $sess->{ErrorNum}; # Do something with $vb->iid and/or $var } if ( $sess->{ErrorNum} ) { # We might do something more interesting than print here. }