K
kellinorman
I have a perl module - just a collection of related subroutines -
called AuditData.pm, which resides in
/usr/local/apache/htdocs/secure/modules. It was a large collection of
subroutines which was taking a long time to "require" as a plain old
..pl file, so I made it into an autoloading module. The perl scripts
that "use" the module reside one directory up, in
/usr/local/apache/htdocs/secure. AuditData.pm also "require"s a few
..pls that live up in the scripts directory - no problem, I just
"require" them using "./scriptName.pl" and that seems to work fine.
The problem seems to be whenever a script that is "require"d by
AuditData.pm, itself "require"s another script that is ALSO "require"d
by the original calling script. So.... if I have (bear with me
here):
/usr/local/apache/htdocs/secure/main.pl
----
require "script1.pl";
require "script2.pl";
use lib "./modules";
use AuditData;
....
and /usr/local/apache/htdocs/secure/modules/AuditData.pm:
----
require "./script1.pl";
and /usr/local/apache/htdocs/secure/script1.pl:
----
require "script2.pl";
&callToSubroutineInScript2();
I get the error (in my apache error log):
Can't locate auto/AuditData/script2.al in @INC (@INC contains:.....) at
../script1.pl line 724.
Line 724 is the &callToSubroutineInScript2.
I know it can't locate the script there (in
/usr/local/apache/htdocs/secure/modules/auto/AuditData) - it's up 3
levels (in /usr/local/apache/htdocs/secure) in the main script
directory. %INC has an entry for "script2.pl". @INC has an entry for
".", which should be /usr/local/apache/htdocs/secure, right? What am I
doing wrong? if I preface all requires with "./", will that fix the
problem?
Thanks in advance for any advice.
Kelli Norman
called AuditData.pm, which resides in
/usr/local/apache/htdocs/secure/modules. It was a large collection of
subroutines which was taking a long time to "require" as a plain old
..pl file, so I made it into an autoloading module. The perl scripts
that "use" the module reside one directory up, in
/usr/local/apache/htdocs/secure. AuditData.pm also "require"s a few
..pls that live up in the scripts directory - no problem, I just
"require" them using "./scriptName.pl" and that seems to work fine.
The problem seems to be whenever a script that is "require"d by
AuditData.pm, itself "require"s another script that is ALSO "require"d
by the original calling script. So.... if I have (bear with me
here):
/usr/local/apache/htdocs/secure/main.pl
----
require "script1.pl";
require "script2.pl";
use lib "./modules";
use AuditData;
....
and /usr/local/apache/htdocs/secure/modules/AuditData.pm:
----
require "./script1.pl";
and /usr/local/apache/htdocs/secure/script1.pl:
----
require "script2.pl";
&callToSubroutineInScript2();
I get the error (in my apache error log):
Can't locate auto/AuditData/script2.al in @INC (@INC contains:.....) at
../script1.pl line 724.
Line 724 is the &callToSubroutineInScript2.
I know it can't locate the script there (in
/usr/local/apache/htdocs/secure/modules/auto/AuditData) - it's up 3
levels (in /usr/local/apache/htdocs/secure) in the main script
directory. %INC has an entry for "script2.pl". @INC has an entry for
".", which should be /usr/local/apache/htdocs/secure, right? What am I
doing wrong? if I preface all requires with "./", will that fix the
problem?
Thanks in advance for any advice.
Kelli Norman