LazerRed has asked for the wisdom of the Perl Monks concerning the following question:
This loops $probe_count times, and pushes the results onto an array later in the script. I'm only grabbing 4 things out of a table that has 8 objects. My question is, Would it be more efficient to do a get_table in one go (and dig around in the returned hash), even though I do not want every piece of data in that table? Essentialy throwing out half the data I collect? LR Whip me, Beat me, Make me use Y-ModemG.foreach my $probe ( 1 .. $probe_count ) { my $location = "$thermbase.1.3.0.$probe"; my $temp = "$thermbase.1.4.0.$probe"; my $thresh = "$thermbase.1.5.0.$probe"; my $cond = "$thermbase.1.6.0.$probe"; my $result = $session->get_request( -varbindlist => [ $location, $temp, $thresh, $cond ] ); if ( !defined($result) ) { printf( "ERROR: %s.\n", $session->error ); $session->close; return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SNMP method efficiency
by bobn (Chaplain) on Jul 22, 2003 at 02:08 UTC | |
by zengargoyle (Deacon) on Jul 22, 2003 at 02:14 UTC | |
by bobn (Chaplain) on Jul 22, 2003 at 02:20 UTC |