Simon,
Your required file may not already be loaded the first time.
Meaning that the file: test.pl will not be loaded until actually
required. But once you use the file, it will be part of the ongoing
process.
Jay Scherrer
On Thu, 2005-12-01 at 12:16 +0800, Simon Wong wrote:
> Dear All,
>
> I have problems of require() function, here is my
> simple program :
>
> test.pl
> -----------
> #!/usr/bin/perl
> require "test01.pl";
>
> test01.pl
> -----------
> #!/usr/bin/perl
> print "content-type:text/html\n\n";
> print "<html><head></head><body>";
> print "this is line one ";
> print "</body></html>";
> 1;
>
> At console mode(perl -W test.pl), the program works
> fine. However it doesn't work well if I use
> browser(tested in Mozilla and IE at remote PC ).
>
> My problems are :
> - The "this is line one" is show on screen. If I press
> 'F5' button to refresh a few time, there was nothing
> show on screen and no error report on apache log
> (error_log), why ?
>
> - Actually I need to type the absolute path in the
> require() function, i.e.
> require("/var/www/html/test01.pl""). What should I do
> if I need relative path ?
>
> My system is Fedora 2, apache 2.0.49 and mod_perl
> 1.99-12.
>
> Thanks you for any advise.
>
> Simon
>