I am having a problem with the following script:

#!/usr/bin/perl -w

use strict;
use Spreadsheet::WriteExcel;

my $workbook  = Spreadsheet::WriteExcel->new("unixsvrs.xls");
my $worksheet = $workbook->addworksheet();

my @date;
my @time;
my @device;
my @address;
my @count;
my $index;
my $data;
my $date;
my $time;
my $device;
my $address;
my $count;

open (INFILE, "unixsvrs.txt.log") || die "$!";

my @lines = <INFILE>;

$index = 0;

foreach $data (@lines) {

        ($date{index},$time{index},$device{index},$address{index},$count{index}) = 
split /\|/,$data;

        printf 
("%s\t%s\t%s\t%s\t%s\n",$date{index},$time{index},$device{index},$address{index},$count{index});

        $index++;
}

It gives me the following error:

Global symbol "%date" requires explicit package name at make_sheet.pl line 30.
Global symbol "%time" requires explicit package name at make_sheet.pl line 30.
Global symbol "%device" requires explicit package name at make_sheet.pl line 30.
Global symbol "%address" requires explicit package name at make_sheet.pl line 30.
Global symbol "%count" requires explicit package name at make_sheet.pl line 30.
Global symbol "%date" requires explicit package name at make_sheet.pl line 32.
Global symbol "%time" requires explicit package name at make_sheet.pl line 32.
Global symbol "%device" requires explicit package name at make_sheet.pl line 32.
Global symbol "%address" requires explicit package name at make_sheet.pl line 32.
Global symbol "%count" requires explicit package name at make_sheet.pl line 32.
Execution of make_sheet.pl aborted due to compilation errors.

If I put my in front of the $date{index}, $time{index}, etc... it tells me that I have 
a syntax error in the printf near the $time{index} entry.

I am lost.

Thanks,

Craig

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to