Spreadsheet::WriteExcel
Spreadsheet::WriteExcel is a cross platform Perl module that can be used to write numbers and text in the native Excel binary file format.
Multiple worksheets can be added to a workbook and cells can be
formatted. The module will work on the majority of Windows, UNIX and
Macintosh platforms. Generated files are also compatible with the
Linux/UNIX spreadsheet applications OpenOffice, Gnumeric and XESS.
Here is a short example of a Perl program that creates an Excel file using the Spreadsheet::WriteExcel module:
#!/usr/bin/perl -w
######################################################################
#
# Example of how to use the Spreadsheet::WriteExcel module to create
# an Excel binary file.
#
use strict;
use Spreadsheet::WriteExcel;
# Create a new Excel workbook called perl.xls
my $workbook = Spreadsheet::WriteExcel->new("perl.xls");
# Add some worksheets
my $sheet1 = $workbook->addworksheet();
my $sheet2 = $workbook->addworksheet();
my $sheet3 = $workbook->addworksheet("Example");
# Add a Format
my $format = $workbook->addformat();
$format->set_bold();
$format->set_size(15);
$format->set_color('blue');
$format->set_align('center');
# Set the width of the first column in Sheet3
$sheet3->set_column(0, 0, 30);
# Set Sheet3 as the active worksheet
$sheet3->activate();
# The general syntax is write($row, $col, $token, $format)
# Write some formatted text
$sheet3->write(0, 0, "Hello Excel!", $format);
# Write some unformatted text
$sheet3->write(2, 0, "One");
$sheet3->write(3, 0, "Two");
# Write some unformatted numbers
$sheet3->write(4, 0, 3);
$sheet3->write(5, 0, 4.00001);
# Write a number formatted as a date
my $date = $workbook->addformat();
$date->set_num_format('mmmm d yyyy h:mm AM/PM');
$sheet3->write(7, 0, 36050.1875, $date);
The resulting Excel file looks like this:

An article about Spreadsheet::WriteExcel appeared in The Perl Journal, Fall 2000. It is reprinted here by kind permission of Jon Orwant and The Perl Journal.
The module is available from CPAN. Read the Spreadsheet::WriteExcel documentation here. You can contact the author at jmcnamara@cpan.org
ActivePerl users can download and install the module using PPM as follows:
C:\> ppm
PPM> set repository tmp http://homepage.eircom.net/~jmcnamara/perl
PPM> install Spreadsheet-WriteExcel
PPM> quit
C:\>
return()