PDA

View Full Version : with Perl can I use parseInt() ? etc Q...


lse123
10-29-2008, 05:27 AM
with Perl can I use parseInt() ?
when a var get value from checkboxes(same name) or multi-select list the
param('checkbox') or param('select') is an array ?
'checkbox','select' form field names.
when I transfer param('checkbox') to a cookie (array) I must use split then to get separate values ? by what char to split ?

KevinADC
10-29-2008, 08:31 AM
If you carefully read the CGI modules documentation you will find the answers to your questions. In a nutshell:

If you parse the form fields individually you assign a multi-value form field to an array:

my @array = param('foo');

where 'foo' is the name of a form field that as multiple values.

If you import all the form fields into a hash then you split the multi-value form fields like so:

@array = split(/\0/, $hash{'foo'});

Go back and read the documentation for the CGI module. I know its long but if you are going to use the module you must read that documentation, carefully. It may take several readings to understand some of it. I still have to go back and read it all the time and I have been using the module for years.

lse123
10-31-2008, 10:08 AM
when I transfer param('checkbox') to a cookie (array) I must use split then to get separate values ? by what char to split ?

I MEAN:

checkboxes with same name how saved in the array ? array or hash (separator) ?
multi-select list how saved in the array ? array or hash (separator) ?
cookies(array) how saved in the array ? array or hash (separator) ?
param('checkbox') or param('select') or cookies(array) or else... when I have an array and when hash ?

FishMonger
10-31-2008, 01:04 PM
Did you not read Kevin's post?
Did you not read the documentation for the CGI module?
Do you not know how to access individual array elements?

Show us your code and explain what you need to accomplish. If your code is generating any warnings and/or errors, please post them as well.

KevinADC
10-31-2008, 07:40 PM
sigh...... nobody reads my posts or they just flame me for asking questions. ;)

FishMonger
10-31-2008, 08:22 PM
sigh...... nobody reads my posts or they just flame me for asking questions. ;)
Shame on you for asking a question. Don't you know that we are never to ask anyone to clarify what they want. ;):o

KevinADC
11-01-2008, 03:18 AM
Shame on you for asking a question. Don't you know that we are never to ask anyone to clarify what they want. ;):o

I'm finding out the hard way. ;)