fixed clear_cache()
This commit is contained in:
13
Info.pm
13
Info.pm
@@ -519,12 +519,18 @@ Clears the cached data. This includes GLOBALS data and TABLE METHOD data.
|
|||||||
=cut
|
=cut
|
||||||
sub clear_cache {
|
sub clear_cache {
|
||||||
my $self = shift;
|
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){
|
foreach my $key (keys %$self){
|
||||||
next unless defined $key;
|
next unless defined $key;
|
||||||
next unless $key =~ /^_/;
|
next unless $key =~ /^_/;
|
||||||
delete $self->{$key};
|
delete $self->{$key};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Clear store for tables
|
||||||
|
$self->store({});
|
||||||
}
|
}
|
||||||
|
|
||||||
=item $info->debug(1)
|
=item $info->debug(1)
|
||||||
@@ -1572,15 +1578,18 @@ sub session {
|
|||||||
return $self->{sess};
|
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, ... } };
|
$info->store = { attribute => { iid => value , iid2 => value2, ... } };
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
sub store {
|
sub store {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
$self->{store} = $_[0] if @_;
|
||||||
return $self->{store};
|
return $self->{store};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user