in reply to Can't locate object method 'new' ??

And I'm assuming it installed correctly ...

There's nothing wrong with the code:

c:\test>copy con testModule.pm #!/usr/bin/perl package testModule; use strict; use warnings; sub new{ my $class = shift; my $self = {}; bless $self, $class; return $self; } sub printSomething{ return 'Something!'; } 1; ^Z 1 file(s) copied. c:\test>copy con testTestModule.pl #!/usr/bin/perl -w use strict; use testModule; my $ob = new testModule; print $ob->printSomething; ^Z 1 file(s) copied. c:\test>testTestModule.pl Something!

Which only leaves an installation error. Wherever it is being installed, it would appear to be somewhere Komodo can find it, but your (default?) Perl installation cannot.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP PCW It is as I've been saying!(Audio until 20090817)

Replies are listed 'Best First'.
Re^2: Can't locate object method 'new' ??
by isshino (Initiate) on Aug 28, 2009 at 02:12 UTC

    Ok, I'm going to try installing it on my server to see if an error that has to do with the way I'm installing it.

    Already tried without the first line and everything was the same. And yes, it has a suffix .pm

    Thanks for the help