in reply to Can't use string as a HASH ref while strict refs
unless that's just a typo, intomy $foo = MyModule::->new($dbh);
Also as was mentioned previously, you probably want to change your new function to start like:my $foo = MyModule->new($dbh);
because the very first thing your new function gets passed when you call it as MyModule->new(), is a scalar containing the string "MyModule". You can bless that scalar into any class you might like, but you can't magically make it turn into a hashref. Without reassigning it anyway.sub new { my $class = shift; my $self = {}; # self is a hashref. bless $self, $class; .... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Can't use string
by wlinx (Initiate) on Jan 09, 2002 at 11:22 UTC | |
by jarich (Curate) on Jan 10, 2002 at 03:17 UTC |