Re: how to define a variable to hold a multiline text input in perl from html multiline textbox

From: Paul Lalli (mritty_at_gmail.com)
Date: 11/29/04


Date: Mon, 29 Nov 2004 20:55:45 GMT


"dale zhang" <zhangd@tycoelectronics.com> wrote in message
news:60460471.0411291238.22fe6793@posting.google.com...
> Here is my script:
>
> #!/usr/bin/perl

<snip>

> sub populatePostFields {
> %postFields = ();
> read( STDIN, $tmpStr, $ENV{ "CONTENT_LENGTH" } );
> @parts = split( /\&/, $tmpStr );
> foreach $part (@parts) {
> ( $name, $value ) = split( /\=/, $part );
> $value =~ ( s/%23/\#/g );
> $value =~ ( s/%2F/\//g );
> $postFields{ "$name" } = $value;
> }
> }
>
> Any suggestions? -Dale

Yes, get rid of this entirely. Use CGI.pm;. Also use strict; and use
warnings;. Read about CGI.pm (and how much easier this code suddenly
becomes once you use it) by typing
perldoc CGI

Paul Lalli



Relevant Pages

  • Re: Comparing files with regular expressions
    ... use strict; ... that matches the exclude file from the complete file (which I'm hoping ... the comparison script is working. ...
    (perl.beginners)
  • Re: help me die verbosely
    ... Does this need to go above or below troublesome code in the script? ... Are the 'strict' and 'warnings' required for this code to work? ...
    (perl.beginners)
  • Re: How can I make my prime number generator better?
    ... I would like to get rid of the goto's but I'm not ... use warnings; ... use strict; ...
    (comp.lang.perl.misc)
  • Re: perl code help
    ... > Following is the script ... It is good practice to import the "strict" module as it ... I have no idea what SomeModuleThatCreatesEntity will be for you as you ...
    (perl.beginners)
  • Re: Please explain @{$y}
    ... from perldoc strict ... This generates a runtime error if you use symbolic references ... 'compile-time error' and 'runtime error' qualifications are at the start ...
    (perl.beginners)