Saron has asked for the wisdom of the Perl Monks concerning the following question:

I have made my constructors:
package HIT; sub new { my $class = shift; my $class = ref($class) || $class; my $self = {}; $self->{Name} = "Default"; $self->{Length} = 0; $self->{Score} = 0; $self->{Expect} = 0; $self->{Ident} = "Default"; $self->{Strand} = "Default"; $self->{Match} = "Deafult"; bless ($self,$class); return $self; }
Everything works well. Until I add a second instance of my object class.
ie $a = new HIT; $b = new HIT;

I have some methods that change each of these variables, only they change BOTH not just one.

Any ideas? I have searched and read FAQ's!
Thanks.

Replies are listed 'Best First'.
RE: Object troubles
by Abigail (Deacon) on Jul 15, 2000 at 13:46 UTC
    I find this a bit hard to believe. But then, we don't see any code of the accessors.

    Can you make a small, complete, program that shows the unwanted behaviour?

    -- Abigail

RE: Object troubles
by toadi (Chaplain) on Jul 13, 2000 at 15:43 UTC
    Before oyu post read please the Guide to the Monastary

    Then the question will get in the right section of the site and will be answered and note voted down !!!

    --
    My opinions may have changed,
    but not the fact that I am right