My script works fine as a standard CGI script. Running under mod_perl, it's sporadic and unpredictable. Sometimes it works, sometimes it craps with an error (but hitting Reload will lead to the proper results), sometimes it will only display the left column. Searching is out of the question. I've yet to get that to work. Hell, the log files don't even show the search request hitting the system.
I've stopped and started Apache so many times that my history file has been rendered useless.
Different browsers give the exact same result, so I know it's not a browser issue.
Other than installing mod_perl and changing httpd.conf, I've changed nothing.
You can compare and contrast as follows:
mod_perl: http://exitwound.org/perl
CGI: http://exitwound.org/music/index.pl
Note the continued necessity of index.pl on the CGI version. God this is fun
Posted from exitwound.org, comment here.
No Difference Here (Score:1)
I dl'd both links, five times each... using wget and the -S option so I could see the server responses.
I also diff'd the files to make sure my eyes were not playing tricks on me.
All files are identical.
I have found that I can greatly reduce browser caching by adding two meta statements to the head section. (I'm leaving out the angle brackets on the ends)
meta http-equiv="Pragma" content="no-cache"
meta http-equiv="Expires" content="-1
P.S. (Score:1)
Re:No Difference Here (Score:1)
If things get any worse, I'll have to ask you to stop helping me.
Re:No Difference Here (Score:1)
http://exitwound.org/perl/index.pl?method=ByArtist
http://exitwound.org/music/index.pl?method=ByArtist
I'll check the diffs with a wget later today. That's a great idea.
If things get any worse, I'll have to ask you to stop helping me.
Re:No Difference Here (Score:1)
This one gave me various responses when it worked. And it gave an error message at times... but returned a status of 200, which is technically OK. But, it did state that there was an internal error.
>http://exitwound.org/music/index.pl?method=ByArtist
This one seemed to work consistently.
This might be a stupid question... but... did you "use strict;" as near the top of the script as you can? Helps me find silly typos all the time...
Some feel that u
Re:No Difference Here (Score:1)
The behavior you've described is exactly what I'm talking about. Sometimes it works, sometimes it doesn't.
I looked through the script for any values that might be hanging around following exectution. The only thing I found that was created but not populated is:
my $template; # use for HTML::TemplateI changed that to
my $template = ' ' ;Still, jickiness prevails.
I really want to stick with HTML::Templates, but everything I've written that doesn't use it works g
If things get any worse, I'll have to ask you to stop helping me.
Re:No Difference Here (Score:1)
Apologies if you already know this ...
If you're using Apache::Registry or similar, then you need to make sure you have no 'file scoped lexicals'. Or in English, use my for variables in subroutines but not for 'globals'. Use 'our' and they really will be globals. eg:
my $id = $query->param('id');
print get_item();
exit;
sub get_item {
# select data using $id
# stick it into the template
}
In this (silly) example, the first time the script is run it will work. The second time