At 9:58 PM -0700 7/9/09, Travis Thornhill wrote:
I'm trying to learn to develop Perl modules in an effort to have
clean directory structure and more reusable code.
I'm hitting a little snag in my test code that I don't quite
understand. I'm hoping someone can help explain where I may be going
wrong here.
The error I'm receiving is this:
ln09{}: perl uses_Mod.pl
Can't locate object method "new" via package "myMod" (perhaps you
forgot to load "myMod"?) at uses_Mod.pl line 11.
I believe that I've done everything I should do to "load" the
module, and can't make it work properly.
The lines of code which "load" the module in my caller are these:
use lib 'Mod';
use Mod::myMod;
The line of code where I get the error is this:
my $obj = myMod->new();
Try this line instead:
my $obj = Mod::myMod->new();
--
Jim Gibson
j...@gibson.org
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/