On Fri, 5 Dec 2003, SRef wrote: > Env: Perl5.8 Apache2.0 mod_perl2.0(1.99xx?) PS: I did try > to find the solution through mod_perl and apache > documents, but in vain. Please help me, thanks. > > For example, I have a script file named "index.cgi" for my > website entrance, and there are some template files in the > same directory with it. index.cgi used to run correctly > under "use warnings(FATAL => 'all'); use strict....." > > when I try using mod_perl, problems occur: > 1. when access my site http://localhost, it shows error"cann't open > http://localhost"; I can only use http://localhost/index.cgi, how to sovle > this?
This seems like a problem with your Apache configuration - see the docs at http://httpd.apache.org/ for details. > 2. it shows many error"sub1 redefined.....sub2 redefined...."when the second > time or more to access the index.cgi. This might be using modules or subroutines whose names coincide - it's hard to know without seeing a simple example of your script. > 3. I use relative path in index.cgi, but it seems all goes mad when > mod_perl::register reports" can't find file1.tmpl...cann't find file2.tmpl" > I think when mod_perl::register works the current working directory is > somewhere else than where index.cgi is. > then i use chdir to change the working directory to where index.cgi is, > I just want to know is there any better way to achieve this since we nearly > always want the current path to be where your script is, rather than > mod_perl::register . I also wonder if chdir will cause any problem with > mod_perl::register . There's been discussion of this in the past - search the archives of the mod_perl mailing list (links are available from http://perl.apache.org/) for a discussion. > 4. Another error, mod_perl::register: Unrecognized character \x11 at > mark.gif. Anything wrong with the gif? Does the gif display OK when loaded in a browser? Again, a simple example illustrating the problem would help. > 5. all globle var in index.cgi used to be "my", but it > says requires explicity package name? I change it to > "local", same proble occurs. When it be"our", no such > error any more? I know difference among them in Perl. But > can anyone explain them to me for mod_perl? Also, why > mod_perl2.0 documents has no info about this? At least, I > didn't find. Try searching at http://perl.apache.org/ for, for example, "scoped variable" - this might lead you to what you're looking for. > 6. use lib './' doesn't work when second(maybe third?) time invoke > index.cgi. > I don't want to put the lib file in perl/lib, nor put the line" use lib > './' " in "start_up.pl". So is there any way to solve this? As with most of the previous questions, it would help quite a bit to see a short snippet of code illustrating the problem, what the error logs say, if anything, and the relevant part of your httpd.conf. -- best regards, randy kobes -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html