I am using: mod_perl/1.26
Now I tried to include subroutines from an external .pl file with "require".
This I got from: http://perl.apache.org/docs/1.0/guide/porting.html#The_First_Mystery
"For example if we move the code from the script into the subroutine run, place the subroutines into the mylib.pl file, save it in the same directory as the script itself and require() it, there will be no problem at all. (Don't forget the 1; at the end of the library or the require() might fail.)"
This is working fine although a mysql database connection in a subroutine in an external file doesn't always work.
The "do" solution I got from: http://perl.apache.org/docs/1.0/guide/ porting.html#Name_collisions_with_Modules_and_libs
-> on the bottom of the page: A hack)
Cheers,
Bart
On Sunday, January 26, 2003, at 05:30 AM, Stas Bekman wrote:
[EMAIL PROTECTED] wrote:Hi,Have you read:
I think mod_perl is wonderful but unfortunately enough the "require" function does not work as it does in CGI.
Is using the function "do" the only workaround as temporary solution till this problem is fixed in a/the next mod_perl version?
http://perl.apache.org/docs/1.0/guide/ porting.html#Name_collisions_with_Modules_and_libs
?
If you are referring to a different problem, what mod_perl version are you talking about?
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com