From f9a97d7a3b0dd21ab0e4715bfd8b5d05ef5b0b82 Mon Sep 17 00:00:00 2001 From: Max Baker <> Date: Tue, 29 Apr 2003 18:00:11 +0000 Subject: [PATCH] fixed clear_cache() --- Info.pm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Info.pm b/Info.pm index f11411ba..7d48e4b1 100644 --- a/Info.pm +++ b/Info.pm @@ -519,12 +519,18 @@ Clears the cached data. This includes GLOBALS data and TABLE METHOD data. =cut sub clear_cache { my $self = shift; + + print "SNMP::Info::clear_cache() - Cache Cleared.\n" if $self->debug(); + # Clear cached global values and table method flag for being cached foreach my $key (keys %$self){ next unless defined $key; next unless $key =~ /^_/; delete $self->{$key}; } + + # Clear store for tables + $self->store({}); } =item $info->debug(1) @@ -1572,15 +1578,18 @@ sub session { return $self->{sess}; } -=item $info->store() +=item $info->store(new_store) -Returns hash store for Table functions. +Returns or sets hash store for Table functions. + +Store is a hash reference in this format : $info->store = { attribute => { iid => value , iid2 => value2, ... } }; =cut sub store { my $self = shift; + $self->{store} = $_[0] if @_; return $self->{store}; }