#!/usr/bin/perl use strict; # USE IT ALL THE TIME use warnings; # USE IT ALL THE TIME use Spreadsheet::WriteExcel; my @model = qw (some random text goes here what else?); my @processor = qw (some random text goes here what else?); my @memory = qw (some random text goes here what else?); my @softwareVersion = qw (some random text goes here what else?); my @devicesPerVariant = qw (some random text goes here what else?); my $devicePerModel = "Hello"; my $workbook = Spreadsheet::WriteExcel->new("test.xls") or die $!; my $worksheet = $workbook->add_worksheet(); my $j = 0; my $rowCounter = 1; #### Declare rowcounter. O/W It is undef the first time around $worksheet->write(0,0 , 'Equipment Model'); $worksheet->write(0,1, 'Devices Per Model'); $worksheet->write(0,2, 'Devices Per Variant'); $worksheet->write(0,3, 'Model Variant Processor'); $worksheet->write(0,4 , 'Device Memory'); $worksheet->write(0,5 , 'Device Software'); for ($j = 1; $j <= $#model; $j++) { $worksheet->write($rowCounter,0, $model[$j]); ### You start with $j = 1 then why are you checking for this????? if ($j == 0) { $worksheet->write($rowCounter,1, $devicePerModel); } # Are you sure that all of your arrays have the same length? $worksheet->write($rowCounter,2, $devicesPerVariant[$j]); $worksheet->write($rowCounter,3, $processor[$j]); $worksheet->write($rowCounter,4, $memory[$j]); $worksheet->write($rowCounter,5, $softwareVersion[$j]); $rowCounter++; } $workbook->close();