Re: [Way OT] perl, CGI, and sendmail

From: David (dbree_at_duo-county.com)
Date: 04/11/05

  • Next message: Ron Johnson: "Re: OT: Bash Scripting Question"
    Date: Sun, 10 Apr 2005 17:27:34 -0500
    To: debian-user@lists.debian.org
    
    

    On Sun, Apr 10, 2005 at 11:25:48PM +0200, Almut Behrens wrote:
    > On Sun, Apr 10, 2005 at 03:39:08PM -0500, David wrote:
    > > I know this ain't Debian but I've racked my brain on this.
    > >
    > > Been experimenting with CGI, using perl. I have a form that generates
    > > the needed variables, etc.
    > >
    > > I have it to where when I submit the data, the mail is sent and I
    > > receive it (FWIW, using exim4), Exim doesn't report any errors, but I
    > > get a 500 error (Internal Server Error) from apache (1.3.33-4).
    >
    > You're not generating any output to return to the browser (you know,
    > that typical pretty useless page "Your mail has been sent. Thank you
    > for ..." ;)

    No, that file I attached was the entire thing - it's just a learning
    project.

    > When a CGI script doesn't produce any output, it's
    > considered an "internal error" by the server.

    But I was getting output. In the sendmail example I included, I
    received a perfect mail. As I said in the OP, no errors showed up in
    the exim logs, but I'd get an "Internal Error" report in the web browser
    and the apache logs reported a 500 error. IOW, it appears that perl
    processed the script all the way but was returning an error to apache
    for some reason.

    If I edited the cgi.pl file by commentint out the sendmail stuff and
    added some html tags and sending to stdout (in the pl), I got the
    correct message in the browser and a 200 status in the logs.

    > If you really do not
    > want to send anything back, you could make use of the HTTP status code
    > 204 (No Content). In this case, both the server and the browser will
    > be happy about not having anything to exchange...
    > If you want to try the latter, but can't figure out how to return 204
    > instead of the normal 200, just report back (maybe off-list, as this
    > really isn't debian any longer :)

    It certainly isn't.. I was just hoping for a quick answer as to what's
    wrong with the script - I'm sure that it's something in the script.

    > BTW, it suffices to simply 'use CGI qw(...);' -- no need for an extra
    > 'require "CGI.pm":'

    I'm rather new to perl and that part was taking an example from a tutorial.

    Actually, I used that tutorial as a pattern to go by.

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Ron Johnson: "Re: OT: Bash Scripting Question"

    Relevant Pages

    • RE: helping writing a script
      ... - Find the portion which contains the "firewalls logs", ... Now it is time to learn some perl. ... For well commented perl script examples search Randal's site at ...
      (perl.beginners)
    • Re: Perl and IIS - script runs but The page cannot be displayed
      ... > I've never run a perl script at the command line. ... >> the logs are located ...
      (comp.lang.perl.misc)
    • Re: apache2 <perl> sections: "*:80 has no VirtualHosts" error
      ... I have no perl skills but this error is caused when apache2 decides that there ... "NameVirtualHost*:80" DO NOT INCLUDE THIS LINE IN ANY OTHER SITE CONFIG THAT ... script at the end of apache2.conf and put that script elsewhere so that if ... BTW none of this is in the new manual or the Debian docs that I coul find. ...
      (Debian-User)
    • Re: Perl environment ask for help
      ... I just installed debian linux on my laptop, and the perl 5.8 is a ... but when i wanna compile my perl script ... Anyone using debian and also using ...
      (comp.lang.perl.misc)
    • uploading files
      ... I'm trying to get the script below to work. ... perl says that it's ok, i cannot check the logs on the server as 1&1 ... server 500 error, with no info on why:(I've checked to see if the script ...
      (comp.lang.perl.misc)