in reply to Anonymous array in object

You are indeed sharing an array. Remember, [ ] isn't an array - it's a reference to an array. And it's that reference that you copied.

One way to solve this is to write.

my $self; $$self{__name} = $fields{__name}; $$self{__mpp} = @{$fields{__mpp}};
Note that with the give code, you don't need to initialize $$self{__name}, as Perl will autovivify it if necessary.