I'm getting the following error: Software error: Can't locate object method "new" via package "A::B" at /path/file.cgi line 5.
My code is basically this:
Expand|Select|Wrap|Line Numbers
#!/usr/bin/perl -w
use strict;
use warnings;
use A::B;
my $test = new A::B;
And in folder A in B.pm:
Expand|Select|Wrap|Line Numbers
package A::B;
use strict;
use warnings;
sub new {
print "Content-type: text/html\n\nHello World!";
}
1;
Obviously this isn't my real code, but I've simplified it. I didn't misspell the package name and I did define the 'new' method. Furthermore, I'm getting the error only when I test in the browser. I use Komodo IDE and it has a compiler and debugger and in Komodo it runs just fine. Also, my colleague (who's unfortunately away now) runs the same code and it's working for him.
I realize I'm not giving a lot of information here, but I don't know what else to specify except I'm on Mac OS X Leopard. I would really appreciate any help. If you need any other information, please ask for what you need to know.