Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

shockme (2685)

shockme
  reversethis-{gro.dnuowtixe} {ta} {kcohs}
http://exitwound.org/
AOL IM: stephenhargrove (Add Buddy, Send Message)

If you really must have more information about me, see my home node [perlmonks.org] at PerlMonks [perlmonks.org] or my journal [exitwound.org] at exitwound.org.

Journal of shockme (2685)

Friday November 14, 2003
03:58 PM

Snatched From The Hands of Victory

[ #15778 ]
Grrr....

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Either you fixed it, or you really do have some browser caching issues.

    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
    • Both links only show the left column.
    • Very cool. I'll check into this. Thanks.
      --

      If things get any worse, I'll have to ask you to stop helping me.

    • Try these links:

      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.

      • >http://exitwound.org/perl/index.pl?method=ByArtist

        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
        • I'm using strict and warnings.

          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::Template

          I 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.

          • 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