CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
"read"

 



jigneshjsoni
User

Mar 4, 2009, 4:29 PM

Post #1 of 2 (617 views)
"read" Can't Post

if (ENV{REQUEST_METHOD} eq 'POST'){

my $query = " " ;

read(STDIN, $query, $ENV{CONTENT_LENGTH}) == $ENV{CONTENT_LENGTH}

or return undef;

push @name_value_pairs, split /&/, $query;

}

In this code $query is set to the value of white space. What kind of syntax is "read(STDIN, $query, $ENV{CONTENT_LENGTH})". I have never used such a syntax. Pls explain this syntax. It looks like, content body of the message is read in the $query. Does all the content (multiple lines) get read at one time only or is it read line by line and every line is split and pushed on to the @name_value_pairs ?

Pls explain


KevinR
Veteran


Mar 4, 2009, 4:45 PM

Post #2 of 2 (615 views)
Re: [jigneshjsoni] "read" [In reply to] Can't Post

just look up the read() function to know what its doing.

Its the really bad way to read POST data into a perl script. What you should be doing is using the CGI module and let it handle to necessary form data parsing.
-------------------------------------------------

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives