Hi Tony
Here is the code:
use strict;
use Carp;
use diagnostics "-verbose";
use warnings;
use Spreadsheet::ParseExcel::Simple;
my @data;
my $ctr;
my $PF;
my $xls = Spreadsheet::ParseExcel::Simple->read('GUI_Status.xls');
my $sheet;
foreach $sheet ($xls->sheets)
{
while ($sheet->has_data)
{
@data = $sheet->next_row;
$ctr = 0;
foreach (@data)
{
if ($ctr == 3) { $PF = $_; } # $ctr = 3
if ($_ =~ m/Bugs/) # $ctr = 4
{
print "\n $PF $_";
#print "\n data = @data";
}
$ctr++;
}
}
}
Here are the diagnostics:
[qaweb@kibbutz tst_spreadsheet]$ perl noname_E.pl
DESCRIPTION OF DIAGNOSTICS
These messages are classified as follows (listed in increasing order
of
desperation):
(W) A warning (optional).
(D) A deprecation (optional).
(S) A severe warning (default).
(F) A fatal error (trappable).
(P) An internal error you should never see (trappable).
(X) A very fatal error (nontrappable).
(A) An alien error message (not generated by Perl).
The majority of messages from the first three classifications above
(W, D & S) can be controlled using the warnings pragma.
If a message can be controlled by the warnings pragma, its warning
category is included with the classification letter in the
description
below.
Default warnings are always enabled unless they are explicitly
disabled
with the warnings pragma or the -X switch.
Trappable errors may be trapped using the eval operator. See
perlfunc/eval. In almost all cases, warnings may be selectively
disabled or promoted to fatal errors using the warnings pragma.
See warnings.
Can't call method "sheets" on an undefined value at noname_E.pl line 14
(#1)
(F) You used the syntax of a method call, but the slot filled by the
object reference or package name contains an undefined value.
Something
like this will reproduce the error:
$BADREF = undef;
process $BADREF 1,2,3;
$BADREF->process(1,2,3);
Uncaught exception from user code:
Can't call method "sheets" on an undefined value at noname_E.pl
line 14.
BTW this works great on Windows!
Thanks for responding!
Larry
Show quoted text-----Original Message-----
From: tony@tmtm.com via RT
[mailto:bug-Spreadsheet-ParseExcel-Simple@rt.cpan.org]
Sent: Wednesday, November 22, 2006 5:24 PM
To: Prucha, Larry
Subject: Re: [rt.cpan.org #23556] Exception error
<URL:
http://rt.cpan.org/Ticket/Display.html?id=23556 >
Prucha, Larry via RT wrote:
> I gather that this only works on a windows box since I get an
exception
> on "sheets" with this:
> "$sheet ($xls->sheets )"
> on a linux machine.
>
I've never tried using this on a Windows machine; it's developed and
tested on Linux. Everything works fine for me, so I'll need a little
more detail to know what's going wrong. Do the tests pass when
installing (or are are they skipped)? What is the actual error you're
getting, in what context? Do you have a simple reproducible test case?
Tony