--- nfo/perl/libs/Data/Mungle/Transform/Deep.pm 2002/12/16 19:57:54 1.5 +++ nfo/perl/libs/Data/Mungle/Transform/Deep.pm 2002/12/23 11:27:53 1.6 @@ -1,8 +1,11 @@ ############################################## # -# $Id: Deep.pm,v 1.5 2002/12/16 19:57:54 joko Exp $ +# $Id: Deep.pm,v 1.6 2002/12/23 11:27:53 jonen Exp $ # # $Log: Deep.pm,v $ +# Revision 1.6 2002/12/23 11:27:53 jonen +# + changed behavior WATCH! +# # Revision 1.5 2002/12/16 19:57:54 joko # + option 'init' # @@ -310,6 +313,7 @@ # loop through fields of to.be.injected-data (arbitrary Perl-data-structure) @fields = keys %{$data} if $options->{init}; +# @fields = keys %{$data} if $options->{mixin}; foreach (@fields) { push @indexstack, $_; @@ -321,7 +325,7 @@ hash2object_traverse_mixin($object->{$_}, $data, 1, $options); } else { my $val = getStructSlotByStringyAddress($data, \@indexstack); - $object->{$_} = $val; + $object->{$_} = $val if defined $val; } pop @indexstack; } @@ -352,10 +356,11 @@ push @indexstack, $i; my $ref = ref $_; # print STDERR "attrname: $_ ATTRref: $ref", "\n"; - if ($ref && $_) { +# if ($ref && $_) { + if ($ref) { hash2object_traverse_mixin($_, $data, 1, $options); } else { - $object->[$i] = $_; + $object->[$i] = $_ if defined $_; } pop @indexstack; $i++;