473,320 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1618
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Carlos Ribeiro | last post by:
Hi all, While writing a small program to help other poster at c.l.py, I found a small inconsistency between the handling of keyword parameters of string.split() and the split() method of...
1
by: jhcorey | last post by:
I don't know where the actual issue is, but hopefully someone can explain. The following displays "5" in FireFox, but "3" in IE: <script type="text/javascript" language="javascript"> var...
5
by: Better but still clumpsy | last post by:
I have the three following scripts. var pat_piece=/(\w{2})-(\w{2,3})/; item=="kpgn9"> var piece=item.split(pat_piece); Netscape is able to split it correctly while IE isn't. What should...
3
by: Davids | last post by:
I noticed this syntax works string myArray = myString.split('.'); instead of string myArray = myString.split("."); I know the split method requires Char but what is really going on here...
2
by: Hai Ly Hoang [MT00KSTN] | last post by:
CString.FormatMessage and CString.Format has the same parameters and they seems to have to outcome. However, they coexist !. There must be some subtle different between they. Can you tell me the...
2
by: Jay | last post by:
So I'm writting this software that talks to an IRC server; and occasionaly IRC servers send back data two lines at a time with lines breaks inside. For my own sanity I had been using the split...
8
by: Ronald S. Cook | last post by:
I notice there are many terms in the .NET Framework like string and String. What's the difference? Which should I use? I also see int and Int32. They are the same? Thanks, Ron
6
by: krishnakant Mane | last post by:
hello, I am strangely confused with a date calculation problem. the point is that I want to calculate difference in two dates in days. there are two aspects to this problem. firstly, I can't get...
9
by: viki1967 | last post by:
Hi all! This new forum its great! :) Congratulations !!! My answer: why this my code not working? Nothing error but not work the difference.... : <html>
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.