Hi NewMonk2Perl, Welcome to the Monastery.
In the Perl community from time to time you'll hear/read "TMTOWTDI", meaning There's more than one way to do it. Have you seen the module Spreadsheet::WriteExcel? You can use it to create Excel documents on various platforms, you don't need excel installed. It has great documentation and Examples.
#!/usr/bin/perl
use strict;
use warnings;
use Spreadsheet::WriteExcel;
my @mydata = (
['Item', 'Category', 'Price'],
['Nails', 'Hardware', '5.25'],
['Shirt', 'Clothing', '23.00']
);
my $workbook = Spreadsheet::WriteExcel->new('test.xls');
my $worksheet = $workbook->add_worksheet();
$worksheet->write_col('A1', \@mydata);
If you're new to Perl I'd suggest working through the following:
Update: I'll leave the formatting of the cells as an exercise for you, it's covered in the Documentation and the examples.
Update 2:Thanks toolc s/next/need/ |