in reply to random array - a newer twist

You are misusing &CGI::param. I believe your usage sets the value of the 'aware02' field to an array of the remaining arguments and returns that array to @array.

Here's how to do what you want:

my @array= map {[param($_)]} ( 'aware02', 'aware03', 'aware04', 'aware05', 'aware06', 'aware07', 'aware08', 'aware09', 'aware10', 'aware11', 'aware12', 'aware13', 'aware14');

The square brackets are in the map block to take care of any multiple valued fields. You'll need to dereference the array elements to get their values.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: random array - a newer twist
by felwick (Sexton) on Nov 05, 2002 at 23:13 UTC
    zaxo - thanks for the quick response....i'm new to CGIpm and have been coding since about 7pm last nite - aka, i'm braindead right now.

    what i'm getting back now is

    <input type="hidden" name="comp1" value="ARRAY(0x102392d4)"> <input type="hidden" name="comp2" value="ARRAY(0x10239388)"> <input type="hidden" name="comp3" value="ARRAY(0x102392ec)"> <input type="hidden" name="comp4" value="ARRAY(0x10237080)"> <input type="hidden" name="comp5" value="ARRAY(0x1023931c)">
    how do i make this mean something?

    thanks, felwick

      That's what I was talking about with 'dereferencing'. Either leave out the square brackets in the map block (if there are no multivalued fields) or else wrap the values you print in '@{}' to dereference them. The References quick reference tutorial by tye may help you a lot.

      You may want to think of other data structures to use. A hash of values keyed by field names is often natural for cgi form data.

      After Compline,
      Zaxo

        checking out the tutorial now....

        thanks, felwick