kinnerc has asked for the wisdom of the Perl Monks concerning the following question:

I'm wondering if anyone had seen this before.

I was working the other day on a simple modification of a form CGI processor in Perl. The HTTP page appeared to pass the data correctly to the form and the form processed it as I expected.

Of course, I had a logic error in the Perl code so I went in to edit the file. I was working with Emacs. I edited the file and retested the code. This time the submit button gave me a completely blank page. I re-edited the Perl code to print a debugging line to the page no matter what the program logic was. Still, it gave me a completely blank page. Nothing I changed in the file would modify this puzzling behavior.

After some hours, I gave up for awhile. What I ended up finding out is that the ~backup files that Emacs creates were interfering with the running of the program in the /cgi-bin directory. As soon as the ~backup file was deleted the Perl CGI program starting running as expected and is now running fine.

Has anyone else seen this behavior? We now know how to fix it - make sure there are no ~backup files in the /cgi-bin directory - but we don't know what's causing the behavior in the first place.

Doc Kinne, KQR American Association of Variable Star Observers

Replies are listed 'Best First'.
Re: Perl, CGI, Emacs ~ files...
by ikegami (Patriarch) on Oct 09, 2007 at 17:26 UTC

    It's not Perl.

    In no particular order,
    Have you checked your error log?
    Have you checked your access log?
    Have you checked your server's documentation?
    Have you checked your server's configuration?
    Have you talked to your server's administrator?
    Have you checked your script?

Re: Perl, CGI, Emacs ~ files...
by amarquis (Curate) on Oct 09, 2007 at 17:00 UTC

    What web server are you running?

    If I had to guess I'd say that the web server has a security feature that disables executing CGI or even serving the directory if there are emacs backup files in there. The idea would be that the emacs backups are there unintentionally and therefore could have unintended consequences (like serving your source code, or running half-edited code).

      I believe this is correct.

      Web Servers will usually crap out if they find a file in the cgi-bin that doesn't execute correctly

        Do you have any reason to believe there was an attempt to execute the backup files?

        Web Servers will usually crap out if they find a file in the cgi-bin that doesn't execute correctly

        I hope you mean, *crap out* if the *specific* file is not executable. (Which is not the case with the OP).

        -derby