Try $ENV{CONTENT_LENGTH} instead. The key item is the underscore
instead of the hyphen. When perl puts all the HTTP header types
into the %ENV hash it transforms the '-' to the '_' so that the
resulting name is a valid perl identifier. 

**** [EMAIL PROTECTED] <Carl Jolley>
**** All opinions are my own and not necessarily those of my employer ****

On Sun, 23 Apr 2000 [EMAIL PROTECTED] wrote:

> Please excuse my ignorance, I'm just starting to learn Perl.  I tried the 
> following simple CGI program that I got from a book on CGI, to no avail.
> 
> The program is supposed to return: "Hey <string from form>, Thanks for 
> registering".  Instead, it returns "Hey, ,thanks for registering".
> 
> Does anyone have a moment to help a newbie?
> 
> THE FORM:
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
> <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
> <meta name="ProgId" content="FrontPage.Editor.Document">
> <title>Page 64</title>
> </head>
> <body>
> <form action="../cgi-bin/getreg2.cgi" method="post">
> <p>Name: <input type="text" size="40" maxlength="40" name="username"></p>
> <p><input type="submit" value="REGISTER"></p>
> </form>
> </body>
> </html>
> 
> THE CGI SCRIPT:
> #!c:\perl\bin\perl.exe
> $size_of_posted_information=$ENV{'CONTENT-LENGTH'};
> read (STDIN, $posted_information, $size_of_posted_information);
> ($field_name, $user_name) = split (/=/, $posted_information);
> $user_name =~ s/\+/" "/eg;
> print "Content-type: text/html", "\n\n";
> print "<html>\n<head>\n<title>Registration Results</title>\n</head>\n";
> print "<body>\n";
> print "<p><font size=5>Hey, ", $user_name, ", thanks for 
> registering!</p>";
> print "</body>\n</html>";
> 
> THANKS FOR YOUR HELP!!!!
> 
> ---
> You are currently subscribed to perl-win32-users as: [EMAIL PROTECTED]
> To unsubscribe, forward this message to
>          [EMAIL PROTECTED]
> For non-automated Mailing List support, send email to  
>          [EMAIL PROTECTED]
> 


---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to