The code below fails on some excel files with the error message:
Can't call method "sheets" on an undefined value at script.pl line 6.
The problem is apparently related to the excel version of the file to be
processed. Saving the file as excel 97 eliminates the problem.
Running the code in debug mode reveals that
Spreadsheet::PExcel::Simple->read() returns an undef value. However,
it's unclear to me which is the offending data element in the input file
causing this return value.

Is there a way to cirvent this problem ? (adding some code to
Spreadsheet::PExcel that takes care of the new (XP or 2003) excel
file format if thats the problem?)


use Spreadsheet::PExcel::Simple;


ARGV or die "Usage: $0 excel-file\n";


my $xls = Spreadsheet::PExcel::Simple->read ($ARGV[0]);
foreach my $sheet ($xls->sheets ()) {
...
}