Re: posting an array
- From: "Mark D Smith" <usenet@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 24 Jul 2005 07:25:02 +0100
"Gunnar Hjalmarsson" <noreply@xxxxxxxxx> wrote in message
news:3kflcuFtuh2fU1@xxxxxxxxxxxxxxxxx
> Mark D Smith wrote:
<snip>
>
> You seem to have missed a few things. First, what you post via a form
> control is a string, not a list.
>
> An array, such as
>
> my @accounts = qw/name1 name2 name3/;
>
> returns a string with the elements separated with spaces and
> concatenated, if you surround it with double quotes.
>
> If the usernames don't contain space characters, you can try
>
> @accounts = split ' ', $in{'accounts'};
>
> Another thing is that your Perl coding style seems to be outdated.
> Please make it a habit to my() declare the variables and enable
> strictures and warnings. Also, it may be a good idea to start using the
> standard module CGI.pm instead of cgi-lib.pl (or whatever code you are
> referring to with "&ReadParse();").
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl
Hi
i do a my @accounts=();
it was only a code snippet.
as to cgi-lib.pl i know but i am updating some old code and it would take a
while to fix all the other bits.
@accounts = split ' ', $in{'accounts'}; works on second page and give the
results i wanted.
what i don't get is the in the first script i am building the array with
push (@accounts, $Euser);
in a while loop so i thought this would build an array which i could then
pass.
the same loop as the second script is used to display what is going to be
passed and that works.
Mark
.
- Follow-Ups:
- Re: posting an array
- From: Gunnar Hjalmarsson
- Re: posting an array
- From: James Taylor
- Re: posting an array
- References:
- posting an array
- From: Mark D Smith
- Re: posting an array
- From: Gunnar Hjalmarsson
- posting an array
- Prev by Date: Re: Connecting to oracle from perl
- Next by Date: How does a scalar know what it is?
- Previous by thread: Re: posting an array
- Next by thread: Re: posting an array
- Index(es):
Relevant Pages
|