Subject: | Proposed Patch |
Date: | Thu, 08 Aug 2013 10:32:29 -0500 |
To: | "SNMP::Info Bug" <bug-SNMP-Info [...] rt.cpan.org> |
From: | Andrew Baumhauer <andy [...] baumhauer.us> |
Gentlemen,
I have located a logic error in version 2.08 of Info.pm that affects the
caching of returned results. Enclosed is a patch for that issue.
--- /2.08/Info.pm 2012-07-15 14:35:37.000000000 -0500
+++ Info.pm 2013-08-08 10:29:12.020871894 -0500
@@ -3825,11 +3825,11 @@
# Load data if it both not cached and we are not requesting
partial info.
if ( defined $funcs{$attr} ) {
return $self->_load_attr( $attr, $funcs{$attr}, @_ )
- unless ( defined $self->{"_${attr}"} and !scalar(@_) );
+ if ( !exists $self->{"_${attr}"} || $_[0]);
}
if ($table_leaf) {
- return $self->_load_attr( $attr, $attr, @_ )
- unless ( defined $self->{"_${attr}"} and !scalar(@_) );
+ return $self->_load_attr( $attr, $attr, @_ )
+ if ( !exists $self->{"_${attr}"} || $_[0]);
}
return $self->_show_attr($attr);