# Also, you should use 'my' to ensure you get a new # array every time while ( my @row = $sth5->fetchrow_array() ) { $round= $row[0]; $teamname= $row[1]; $score= $row[2]; # If you're running in a webserver, this should # appear in the error log. You can also try # to print this out to the browser. warn "Retrieved row: ($round) ($teamname) ($score)\n"; $list_of_teamdata[$pain][0] = $round; $list_of_teamdata[$pain][1] = $teamname; $list_of_teamdata[$pain][2] = $score; ... }