Saron has asked for the wisdom of the Perl Monks concerning the following question:
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.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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Object Troubles
by davorg (Chancellor) on Jul 13, 2000 at 12:27 UTC | |
|
Re: Object Troubles
by mikfire (Deacon) on Jul 13, 2000 at 16:52 UTC | |
by CMonster (Scribe) on Jul 13, 2000 at 18:40 UTC | |
by chromatic (Archbishop) on Jul 13, 2000 at 19:17 UTC | |
by mikfire (Deacon) on Jul 13, 2000 at 19:52 UTC | |
by davorg (Chancellor) on Jul 13, 2000 at 19:00 UTC | |
|
(chromatic) Re: Object Troubles
by chromatic (Archbishop) on Jul 14, 2000 at 02:48 UTC |