Re: posting an array




"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








.



Relevant Pages

  • Re: enum and combobox
    ... array that is returned to the combobox. ... Mark ... >> Use a loop to iterate over and assign to your> combobox. ...
    (microsoft.public.dotnet.languages.csharp)
  • RE: A little Macro Help Please ...
    ... "mark" wrote: ... The code below has a 2 dimension array which contains the field to apply the ... criterion to, ... E, places the cursor in the cell F3, and turns the protection back on. ...
    (microsoft.public.excel.programming)
  • Re: Please help optimize (and standarize) this code...
    ... > Mark F. Haigh wrote: ... But the reason I didn't use an array of strings in the ... What's the biggest number of elements that your array can have? ...
    (comp.lang.c)
  • Re: Set A Parameter Without Redirecting A Page?
    ... Mark Fitzpatrick wrote: ... using AJAX because then you wouldn't be posting back the whole page. ... I am trying to set a parameter - ResponseId = 4 inside a while loop. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Incrementing a month value
    ... then runs a loop that the user inputs a number of months ... >> With each loop I have used the stored procedure DateAdd to increase the ... Hi Mark ... if TA# is a text field, enclose strTA with single quotes as below (I ...
    (microsoft.public.access.modulesdaovba)