新手出錯了

新手出錯了

#!c:\perl\bin;
use strict;
use warnings;
use DBI;
use DBD::mysql;
my $dbh = DBI->connect("DBI:mysql:tucc", "root", "billtuc") or die ("can not create a connected for database",DBI->errostr(),"\n");
my $sth = $dbh->prepare(q{select * from book}) or die("數據庫連接失敗","\n");
$sth->execute() or die("can not execute the statment",$sth->errostr(),"\n");
my @array;
while ( @array= $sth->fetchrow_array()){
        write();
}
warn($DBI::errstr) if DBI::err;
$dbh->disconnect();
$sth->finish();
print STDOUT @array[0]


E:\perltst>perl perl58.pl
Scalar value @array[0] better written as $array[0] at perl58.pl line 16.
Undefined format "STDOUT" called at perl58.pl line 11.
数组@array的第一值应该是标量$array[0]。
謝謝樓上的兄弟!