The code you posted does not return any errors.
Check the parts you didn't post.



-----Original Message-----
From: Tommy Grav [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 28, 2006 1:48 PM
To: beginners@perl.org
Cc: Tommy Grav
Subject: Array of arrays

I have a file of numbers that I want to read in and put the first 12  
lines into row one of
of a two-dimensional array, the next 12 into row two and so on.

        my $nref = 12 ;
        my $n = 0 ;
        my $im = 0 ;
        my @refstars ;
        my @refmag ;

        while (<>) {
            my ($mag, $merr) = split ;

            $refmag[$n] = $mag ;
            $n++ ;
            if($n==$nref) {
                $n = 0 ;
                push @refstars, [EMAIL PROTECTED] ;
                $im++ ;
            }
        }
        printf(" We have $im images with $nref reference stars \n") ;
        print $refstars[0][0] ;
        print $refstars[1][0] ;  # <- This is line 38

However this code returns an error I do not understand

        Missing right curly or square bracket at refstar.pl line 38, at
end  
of line
        syntax error at refstar.pl line 38, at EOF
        Execution of refstar.pl aborted due to compilation errors.

Anyone know what I am doing wrong?

Cheers
Tommy


[EMAIL PROTECTED]
http://homepage.mac.com/tgrav/

"Any intelligent fool can make things bigger,
more complex, and more violent. It takes a
touch of genius -- and a lot of courage --
to move in the opposite direction"
                          -- Albert Einstein




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to