AI-ExpertSystem-Advanced
view release on metacpan or search on metacpan
lib/AI/ExpertSystem/Advanced/Dictionary.pm view on Meta::CPAN
159160161162163164165166167168169170171172173174175176177178179=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!"
;
}
}
( run in 0.213 second using v1.01-cache-2.11-cpan-454fe037f31 )