dime has asked for the wisdom of the Perl Monks concerning the following question:
I am instantiating two objects in the following way:
my $query = new MyPackage::Query("utf8"); my $query2 = new MyPackage::Query("euc-jp");
Both end up working with euc. What is going wrong? Here's a short version of my constructor:
sub new { my $class = shift; $self->{input_enc} = shift; unless (defined $self->{input_enc}) { $self->{input_enc} = "euc-jp"; } #... bless($self, $class); return $self; }
Please tell me if I'm already messing up in the basics or if the mistake is likely to be in the #... part.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Overwritten instance variables
by moritz (Cardinal) on Aug 03, 2009 at 09:06 UTC | |
|
Re: Overwritten instance variables
by tokpela (Chaplain) on Aug 03, 2009 at 09:14 UTC |