I am working on an extensive project that heavily exploits object-oriented Perl. Recently I have been having trouble creating objects via the "new" method between the many different modules. Up until now I have been able to use the prefix form of
my $object = new Some::Random::Module();
and everything worked fine. However, after a few module additions, I have been getting this error:
Undefined subroutine &Some::Random::Module called at /perlmodules/Anot
+her/Different/Module.pm line 92.
To correct this error I simply have to change my above syntax to
my $object = Some::Random::Module->new();
and everything continues on fine. This error has been continually poping up over the course of today and is trying my patience-- is there a reason why I must use one syntax over another, and is there any technical difference between the two syntaxes?
The collection of modules in the project has many interdependencies between them. I have tried different combinations of use, require and BEGIN, and the problem never completely goes away. Yes, I have checked to make sure that all of the correct files have the appropriate use/require statements in them.