Hello all. I have trying to push a value onto the end of a two-dimension
array. Here is my code.

                        if( /\s+--\s+COLS\.\s+(\d+)\s+-\s+(\d+)\s+--/ ) {
                                push( @{questionpos[$questionno]}, $1 );
                                push @questionlength[$questionno], ( $2 - $1
+ 1 );
                        } elsif( /\s+--COL\.\s+(\d+)\s+--/ ) {
                                push @questionpos[$questionno], $1;
                                push @questionlength[$questionno], 1;
                        }
                        print "Match column definition
\@$questionpos[$questionno][$#questionpos[$questionno]]\n" if( $d == 1 );

I tried a couple different things, but it wouldn't work right. How do I push
these values? Thanks.
The question length array should get the value push onto the array subscript
questionno. I am getting the following errors:

Scalar value @{questionpos[$questionno] better written as
${questionpos[$questionno] at ./get_formats.pl line 50.
Type of arg 1 to push must be array (not array slice) at ./get_formats.pl
line 50, near "$1 )"
Scalar value @questionlength[$questionno] better written as
$questionlength[$questionno] at ./get_formats.pl line 51.
Type of arg 1 to push must be array (not array slice) at ./get_formats.pl
line 51, near ");"
Scalar value @questionpos[$questionno] better written as
$questionpos[$questionno] at ./get_formats.pl line 53.
Type of arg 1 to push must be array (not array slice) at ./get_formats.pl
line 53, near "$1;"
Scalar value @questionlength[$questionno] better written as
$questionlength[$questionno] at ./get_formats.pl line 54.
Type of arg 1 to push must be array (not array slice) at ./get_formats.pl
line 54, near "1;"
Can't use subscript on array length at ./get_formats.pl line 56, near
"$questionno]"
Execution of ./get_formats.pl aborted due to compilation errors.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to