Thanks for the quick respons, just need a bit more help. Now I need to write these values in a text file (I am fully aware of writing to files) but where I am gettin' confused is that : I told you that Name is a required field, but Email is optional. so what if :

my @name = ('Sara', 'John', 'Doe'); # 3 names coming from form.
my @email = ('[EMAIL PROTECTED]'); # coming from form as Email Optional field is ONLY filled for John.

The problem is $name[0] does not corresponds with $email[0] and so on.... Otherwise I would have used while or foreach for @name and @email to write it to file like it:

### TEXT FILE TO WRITE #######
Sara |
John | [EMAIL PROTECTED]
Doe |
##############################

Thanks again for your help.

Sara.



----- Original Message ----- From: "Ovid" <[EMAIL PROTECTED]>
To: <beginners-cgi@perl.org>
Sent: Saturday, October 29, 2005 9:14 AM
Subject: Re: Taking Multiple Values for The Same Form Field.


--- Sara <[EMAIL PROTECTED]> wrote:


use CGI;
my $q = new CGI;

my $name = $q->param('name');

Now What as multiple name values will be coming.............??

Use list context:

 my @names = $q->param('name');

Cheers,
Ovid

--
If this message is a response to a question on a mailing list, please send
follow up questions to the list.

Web Programming with Perl -- http://users.easystreet.com/ovid/cgi_course/

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to