我强烈建议Spreadsheet::WriteExcel为您的需要。该库完全用Perl编写,因此您只需将CPAN库上传到您的网站并指定具体位置即可。下面的库文档和代码片段将帮助您开始。
#!/usr/bin/perl -w
use strict;
use lib qw(./lib); # Place for the downloaded WriteExcel library
use Spreadsheet::WriteExcel;
# Send headers
print "Content-type: application/vnd.ms-excel\n";
print "Content-disposition: attachment;filename=rollcharts.org.xls\n\n";
# Create a new workbook and add a worksheet
my $workbook = Spreadsheet::WriteExcel->new("-");
my $worksheet = $workbook->add_worksheet("Colorful Example");
# Create a new format with red colored text
my $format = $workbook->add_format();
$format->set_color('red');
# Add header
$worksheet->write(0, 0, "Fruit.", $format);
$worksheet->write(0, 1, "Cost", $format);
# Add Data
$worksheet->write(1, 0, "Apple");
$worksheet->write(1, 1, "10.25");
# Close Workbook
$workbook->close();
您是否尝试过使用Google搜索“perl excel”?我发现在这个主题上有很多很好的教程。 – 2009-12-02 16:01:08