in reply to Strange method behavior

Is this the code you are actually using or is it a stripped version?
One things you could test doing is having a sub like this:
sub format_cell3 { my ($self,$format) = @_; $self->{cell_format}[0]{bgcolor} = $format->{bgcolor}; }
If this simplified case still doesn't work then something is definately wrong.
In your assignment you should only need this initital -> and from there on you simply have a HoAoH to deal with.

Replies are listed 'Best First'.
Re: Re: Strange method behavior
by Trimbach (Curate) on Dec 17, 2000 at 07:26 UTC
    My code samples were complete... just cut 'n pasted directly from my source. I just tried naming the key directly instead of relying on keys %$format and got the same, "change-all-objects-everywhere" behavior.

    I'll agree with the "something is definitely wrong" part... I've isolated everything down to the subs I referenced, because I've tested all the values of $self->{cell_format} in the subs immediately before assignment, and then immediately after and the assignment is definitely the culprit.

    Gary Blackburn
    Trained Killer

      How are you building your object? Are you creating an object from scratch or passing the same one back? It sounds almost like each instance of your object is pointing to the same thing...