Try defining your hashes like you did with the variables.....
actually.. it looks like you defined scalar variables and not hashes....
it should be
my %date; #not my $date
my %time; # not my $time
Hope this helps!
-Ope Bakare
"Craig Sharp" <[EMAIL PROTECTED]> on 03/05/2002 11:32:02 AM
To: [EMAIL PROTECTED]
cc: (bcc: Opeyemi Bakare/WTC1/Empire)
Subject: [Perl-unix-users] strict help needed !!!!
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
"Empire Blue Cross Blue Shield" made the following
annotations on 03/05/02 11:41:53
------------------------------------------------------------------------------
[INFO] -- Access Manager:
Attention! This electronic message contains information that may be legally
confidential and/or privileged. The information is intended solely for the individual
or entity named above and access by anyone else is unauthorized. If you are not the
intended recipient, any disclosure, copying, distribution, or use of the contents of
this information is prohibited and may be unlawful. If you have received this
electronic transmission in error, please reply immediately to the sender that you have
received the message in error, and delete it.
_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs