470,600 Members | 1,489 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,600 developers. It's quick & easy.

Difference in split funciton parameters

Hi,

I'm a newbie of perl language and I would like to ask the differences
in below pieces of code:

1.
read(STDIN, $stuff, $ENV{'CONTENT_LENGTH'});
@pairs = split(/\&/, $stuff);

2.
read(STDIN, $stuff, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $stuff);

Do they both get a blob of data with length specified by the
CONTENT_LENGTH environment variable then split the name=value pairs
separated by '&' characters ?

Tks!
Jul 19 '05 #1
1 1553
lonelyplanet999 wrote:
I'm a newbie of perl language and I would like to ask the
differences in below pieces of code:

1.
read(STDIN, $stuff, $ENV{'CONTENT_LENGTH'});
@pairs = split(/\&/, $stuff);

2.
read(STDIN, $stuff, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $stuff);

Do they both get a blob of data with length specified by the
CONTENT_LENGTH environment variable then split the name=value pairs
separated by '&' characters ?


Yes.

You know that there is a standard module that can be used for parsing
form data, right?

use CGI;

See http://stein.cshl.org/WWW/software/CGI/

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

11 posts views Thread by Carlos Ribeiro | last post: by
1 post views Thread by jhcorey | last post: by
5 posts views Thread by Better but still clumpsy | last post: by
3 posts views Thread by Davids | last post: by
2 posts views Thread by Hai Ly Hoang [MT00KSTN] | last post: by
2 posts views Thread by Jay | last post: by
8 posts views Thread by Ronald S. Cook | last post: by
6 posts views Thread by krishnakant Mane | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.