perl DBI excel 大数据问题

perl DBI excel 大数据问题

1. 代码如下:

use strict;
use Spreadsheet::WriteExcel;
use DBI;

my $sql = 'select * from users';
my $DSN = "driver={SQL Server};Server=$datahost; database=$database;uid=$username;pwd=$password;";
my $dbh = DBI->connect("dbi:ODBCDSN") or die "$DBI::errstr\n";

my $sth = $dbh->prepare($sql);
$sth->execute();

my $wb = Spreadsheet::WriteExcel->new('t.xls');
my $worksheet = $wb->add_worksheet();

my $count = 0;
while(my @row = $sth->fetchrow_array) {
    $count++;
    for(my $i=1;$i<=$sth->{NUM_OF_FIELDS};$i++) {
        my $line = $i-1;
        $worksheet->write(0,$line,$sth->{NAME}->[$line]);
        if(@row[$line]) {
            $worksheet->write($count,$line,@row[$line]);
        }
        else {
            print "data is null\n";
        }
    }
}



2. users表里面有 30100条数据.  共计: 42个字段.

3. 执行脚本, 写入200多条数据,提示错误.  错误如下:

Couldn't parse formula: =NT=Win=Philip

4. 如果写到文本文件里面, 就没有任何问题.  谁能解释一下为什么这样?? 怎么解决???? 谢谢,
谢谢.
http://www.google.com/search?hl= ... ;btnG=Google+Search

要学会用 google 啊