[LON-CAPA-dev] Re: [LON-CAPA-cvs] cvs: loncom /auth lonacc.pm

Scott Harrison lon-capa-dev@mail.lon-capa.org
Mon, 25 Feb 2002 17:05:04 -0500


Minor bleep:
And if you want that perl array to be read/write, then
my $localarrayref=$ENV{'form.'.$name.'[]'};

Guy Albertelli II wrote:
> 
> Actually to be even closer to the request
> 
> this code will put a value in form.$name and a perl array will be in
> form.$name[]
> 
>     if ($ENV{"form.$name"}) {
>         if (defined($ENV{'form.'.$name.'[]'} })) {
>             #already have multiple values
>             push(@{ $ENV{'form.'.$name.'[]'} },$value);
>         } else {
>             #first multiple values, create an array
>             push(@{ $ENV{'form.'.$name.'[]'} },$ENV{"form.$name"},$value);
>         }
>      } else {
>         $ENV{"form.$name"}=$value;
>      }
> 
> my @localarray=@{ $ENV{'form.'$name.'[]'} };
> 
> --
> albertel@msu.edu        BM: n^20 t20 z20 qS
> Guy Albertelli -7-9-8-  O-
>     I would love to but . . . it wouldn't be fair to the other Beautiful
>     People.
> _______________________________________________
> LON-CAPA-dev mailing list
> LON-CAPA-dev@mail.lon-capa.org
> http://mail.lon-capa.org/mailman/listinfo/lon-capa-dev

-- 
Scott Harrison -- Graduate Student
Microbiology and Molecular Genetics
Mich. State. Univ., East Lansing, MI
harris41@msu.edu, 517-353-0998