On Thu, 18 Mar 2004 13:40:10 +0000, Gunnar Hjalmarsson wrote:
Michael wrote: I am implementing a script that my client wants on their website.
Within the script there are several "require" statements. Any time
one of these "require" statements is executed, the script
terminates.
Any ideas how I might solve this problem?
How about installing the modules that it tries to require? Just a thought.
The files are installed just where I believe they need to be. Here is the
code that is giving me the problem:
&require_suppor ting_libraries
(__FILE__, __LINE__,
"$path/file1.cfg",
"$path/file2.cfg",
"$path/library/file3.pl",
"$path/html/file4.pl",
"$path/library/file5.pl");
sub require_support ing_libraries
{
local ($file, $line, @require_files) = @_; local ($require_file) ;
foreach $require_file (@require_files )
{
if (-e "$require_f ile" && -r "$require_file" )
{
print "$require_f ile <br><br>";
require '$require_file' ;
}
}
}
When I run the code the path and name of the first file is printed to the
browser window. Only the first file is listed. If I comment out the
require statement, all of the files are listed. Clearly the code is
finding the files (as it makes it into the if code block) but when the
require statement is executed, the code terminates.
rats.
Is there a problem with the syntax of the require statement? Or maybe the
permissions of the files needs to be different?
Any ideas will be appreciated.
Cheers!