Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Perl Misc (http://www.velocityreviews.com/forums/f67-perl-misc.html)
-   -   Use of freed value in iteration (http://www.velocityreviews.com/forums/t887527-use-of-freed-value-in-iteration.html)

Stuart Kendrick 08-05-2004 01:43 PM

Use of freed value in iteration
 
hi folks,

i don't understand why Perl bombs with 'Use of freed value in
iteration' in my code below... i don't see where i'm modifying the
contents of %esx in my loop. can anyone see what i'm missing?

guru> cat test
#!/opt/local/bin/perl

use strict;
use warnings;
use SNMP;

my $obj = "sysDescr";
my $read = "public";
my ($sess, $val, $vb);

my %esx = ( "10.10.22.8" => "b2-esx",
"10.10.16.8" => "a1-esx",
"10.10.18.8" => "a2-esx",
"10.10.20.8" => "a3-esx",
);

for my $addr (keys %esx) {
print "Processing $addr\n";
$sess = new SNMP::Session ( Community => $read,
DestHost => $addr,
);
$vb = new SNMP::Varbind([$obj]);
$val = $sess->bulkwalk('0', '10000', $vb);
print "Finished $addr\n";
}

guru> ./test
Processing 10.10.18.8
Finished 10.10.18.8
Processing 10.10.22.8
Finished 10.10.22.8
Use of freed value in iteration at ./test line 24.
guru>

Notes:

-line 24 is the 'print "Finished $addr\n";' line.

-naturally, im my real code, i'm not performing snmpbulkwalks on
sysDescr ... but this snippet replicates the problem and produces much
simpler output.

-perl 5.8.5, net-snmp 5.0.9


--sk

stuart kendrick
fhcrc


All times are GMT. The time now is 09:43 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.