The following is not a CGI script (it doesn't produce headers or any useful output) but it does show how you can log the name of the script, the directory it is located in, the process id it is running as and a version. You could incorporate something similar into your script.

#!/usr/bin/perl use strict; use warnings; use FindBin; my $VERSION = "1.0"; print STDERR "This is $0 version $VERSION located in $FindBin::Bin run +ning as process $$\n";

Output from a few executions is as follows:

ian@laptop2:~$ ./test.pl This is ./test.pl version 1.0 located in /home/ian running as process +6119 ian@laptop2:~$ ./test.pl This is ./test.pl version 1.0 located in /home/ian running as process +6120 ian@laptop2:~$ ./test.pl This is ./test.pl version 1.0 located in /home/ian running as process +6121

Note that the process id is different every time I run the script.

If you add similar logging to your CGI script, you should be able to find the output in your website error log. Then, if you change the version number every time you change the script, you will have a record of what version was running and what process number was running it. You could change only the version number, just to make a change, then restart your server and check the logs for entries with the old version number appearing after the restart. If you find one, use the ps command to find out what the process is. This will help to isolate the problem.

If you see a log entry on your server every time you submit a request from your browser, then it is reasonable to conclude the requests are making it to the server. There is still the possibility that the requests and/or responses are being modified between the server and browser. This is unusual, but it can happen. Don't worry about that yet. First, confirm that the server is running your script once for each request from the browser. Then confirm that each time your server runs your script it runs the "current" version. You might include the scripts version number in both the log and the response to the browser: you can put it in an HTML comment if you don't want it to be visible in the browser. Then you can check that the response received at the browser is from the current version of your script, or at least the same as the version that ran on the server.


In reply to Re^9: apache/perl caching problem by ig
in thread apache/perl caching problem by ksublondie

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.