Running Perl CGI from Windows

Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default Running Perl CGI from Windows

    Hi all,

    I hope this is not too off-topic, since I hesitate to subscribe to yet another list...

    I wrote a very simple CGI script to read data from an HTML form like this:

    my $q = new CGI;

    my $name = $q->param('name');
    my $message = $q->param('message');
    my $email = $q->param('email');

    Later, the script opens a pipe to sendmail and prints a message into the pipe. It works fine when I tested it on my machine (Mac OS X). So far, so good.

    But accessing the script from a Windows machine gives me the prepared errormessage. From the log I can see that all parameter values end up in the $name variable, along with the names of the second and third parameter. So the value of $name is:

    John Doe email=john@doe.com message=This is the message

    Note that the first parameter's name does not appear.

    I suspect the problem has to do with line endings (\r vs \n), but I cannot figure out at which point of the process line endings could matter.

    Any ideas?

    TIA,

    Jan
    --
    There are 10 kinds of people: those who understand binary, and those who don't
    Jan Eden Guest

  2. Similar Questions and Discussions

    1. running sql scripts from perl script
      I am not sure if this probleem is primarily perl or MySQL, so I'll try here first. With any luck, there is someone else here who uses perl to run...
    2. Off Topic: Active Perl Native Windows / cygwin perl
      I have both activestate windows native perl installed and the default cygwin perl. How can I have the cygwin shell use the windows perl rather...
    3. perl not running correctly
      Scott Blankenship wrote: Nothing is wrong with Perl, but unlike in MSDOS ".", isn't usually if the $PATH. You have to reference the file with...
    4. Running a Perl Script in ASP.NET
      Hello, i want to create an active webpage that displays the status of users quotas on a volume of a server. I installed IIS on this server and...
    5. running UNIX with perl
      Dear Gurus, I got stuck at the following. I've tried running a UNIX command in my Perl CGI-script, but it doesn't work the way I expected it to....
  3. #2

    Default Re: Running Perl CGI from Windows

    Hi Wolf,

    wolf blaum wrote:
    >For Quality purpouses, Jan Eden 's mail on Friday 30 January 2004
    >20:01 may have been monitored or recorded as:
    >>Hi all,
    >Hi ...
    >>But accessing the script from a Windows machine gives me the
    >>prepared error message. From the log I can see that all parameter
    >>values end up in the $name variable, along with the names of the
    >>second and third parameter. So the value of $name is:
    >>
    >>John Doe email=john@doe.com message=This is the message
    >>
    >>Note that the first parameter's name does not appear.
    >
    >What does your <form action=..... > tag look like?
    >
    Like this:

    <form action="cgi-bin/mail_form.pl" method="post" enctype="text/plain" accept-charset="iso-8859-1"> ... </form>

    - Jan
    --
    There's no place like ~/
    Jan Eden Guest

  4. #3

    Default Re: Running Perl CGI from Windows

    For Quality purpouses, Jan Eden 's mail on Friday 30 January 2004 20:01 may
    have been monitored or recorded as:
    > Hi all,
    Hi
    ...
    > But accessing the script from a Windows machine gives me the prepared error
    > message. From the log I can see that all parameter values end up in the
    > $name variable, along with the names of the second and third parameter. So
    > the value of $name is:
    >
    > John Doe email=john@doe.com message=This is the message
    >
    > Note that the first parameter's name does not appear.
    What does your <form action=..... > tag look like?

    Wolf




    Wolf Blaum Guest

  5. #4

    Default Re: Running Perl CGI from Windows

    For Quality purpouses, Jan Eden 's mail on Friday 30 January 2004 20:17 may
    have been monitored or recorded as:

    Hi Jan
    > Like this:
    >
    > <form action="cgi-bin/mail_form.pl" method="post" enctype="text/plain"
    > accept-charset="iso-8859-1"> ... </form>

    Try enctype="application/x-www-form-urlencoded" instead.
    I had the very same problem using the xitami webserver on WinOs.
    Dont ask me were that problem comes from - no clue:-)

    Hope that works,
    Wolf


    Wolf Blaum Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139