APM: The situation- Re: How to psudo-array: $a$b ???

CaptNemo CaptNemo at Austin.rr.com
Tue Oct 24 09:01:19 PDT 2006


I'm trying to build a FORM page that will make a nice easy interface for my 
dumb co-workers to use to query MYSQL.

The HTML page generates a FORMS page which consists of 5 lines of 
PULL-DOWN  PULL-DOWN  TEXT-BOX:

_TABLE_COL_HEADERS_     _>_<_=_!=_      _TEXT_BOX_FOR_OPERATOR_INPUT_
_TABLE_COL_HEADERS_     _>_<_=_!=_      _TEXT_BOX_FOR_OPERATOR_INPUT_
_TABLE_COL_HEADERS_     _>_<_=_!=_      _TEXT_BOX_FOR_OPERATOR_INPUT_
_TABLE_COL_HEADERS_     _>_<_=_!=_      _TEXT_BOX_FOR_OPERATOR_INPUT_
_TABLE_COL_HEADERS_     _>_<_=_!=_      _TEXT_BOX_FOR_OPERATOR_INPUT_

These are assigned the names of:
         qa0, qb0, qc0
         qa1, qb1, qc1
         qa2, qb2, qc2
         qa3, qb3, qc3
         qa4, qb4, qc4

         ...which are POSTed to the next script.

For some reason, when I :

         my @qa;
         my @qb;
         my @qc;

         for ($count=0; $count<=4; $count++)
                 {
                 $qa[$count] = param ('qa$count');
                 $qb[$count] = param ('qb$count');
                 $qc[$count] = param ('qc$count');
                 }

I don't get any of the values. The @qa, @qb & @qc variables are empty.

BUT, when I use:
         my $qa0 = param ( 'qa0' );
         my $qb0 = param ( 'qb0' );
         my $qc0 = param ( 'qc0' );
         my $qa1 = param ( 'qa1' );
         my $qb1 = param ( 'qb1' );
         my $qc1 = param ( 'qc1' );
         my $qa2 = param ( 'qa2' );
         my $qb2 = param ( 'qb2' );
         my $qc2 = param ( 'qc2' );
         my $qa3 = param ( 'qa3' );
         my $qb3 = param ( 'qb3' );
         my $qc3 = param ( 'qc3' );
         my $qa4 = param ( 'qa4' );
         my $qb4 = param ( 'qb4' );
         my $qc4 = param ( 'qc4' );
         my $qa5 = param ( 'qa5' );
         my $qb5 = param ( 'qb5' );
         my $qc5 = param ( 'qc5' );
         my $qa6 = param ( 'qa6' );
         my $qb6 = param ( 'qb6' );
         my $qc6 = param ( 'qc6' );

The values are returned fine...


I'm stumped (AGAIN)






>Anyone know if it's possible (and how) to make a psudo-array?
>
>Meaning, is there a way to make an array WITHOUT using an array variable:
>
>I wanted three sets of 5 variables:
>         $a1 $b1 $c1
>         $a2 $b2 $c2
>         $a3 $b3 $c3
>         $a4 $b4 $c4
>         $a5 $b5 $c5
>
>         ...but I really didn't want to use an @array variable (I'm having 
> trouble
>with param() with array variables).
>I'd like to use a FOR loop to handle these variables but, perl doesn't like:
>
>for ($count.....
>         {
>         $a$count = par....
>         $b$count =....
>         $c$count...
>         }
>
>(I think perl sees these as two variables)
>Any of you guys know how I can do this (without an @array)?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/austin/attachments/20061024/4b882ee2/attachment-0001.html 


More information about the Austin mailing list