AI-ExpertSystem-Advanced

 view release on metacpan or  search on metacpan

lib/AI/ExpertSystem/Advanced/Dictionary.pm  view on Meta::CPAN


=head2 B<update($id, %extra_keys)>

Updates the I<extra> keys of the element that matches the given C<$id>.

Please note that it will only update or add new keys. So if the given element
already has a key and this is not provided in C<%extra_keys> then it wont
be modified.

=cut
sub update {
    my ($self, $id, $properties) = @_;

    if (defined $self->{'stack_hash'}->{$id}) {
        foreach my $key (keys %$properties) {
            $self->{'stack_hash'}->{$id}->{$key} = $properties->{$key};
        }
    } else {
        warn "Not updating $id, does not exist!";
    }
}

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.519 second using v1.00-cache-2.02-grep-82fe00e-cpan-b63e86051f13 )