gauss76 has asked for the wisdom of the Perl Monks concerning the following question:
Hi All
I have the following problem. When I try to open an Excel xlsx file that is actually an old .xls type file with the perl module Spreadsheet::ParseXLSX my program crashes with an error. I have tried putting the command in an eval statement as below but this does not work. Is there any way to trap the error?
$FileToOpen=myfile.xlsx; my $parser=Spreadsheet::ParseXLSX->new(); my $xxx=eval{$parser->parse($FileToOpen)};When I run the code I get a load of errors from the $parse statement followed by the result of $xxx is:Spreadsheet::ParseExcel::Workbook=HASH(0x5c05968)
Am I using eval incorrectly or is there something else I am missing?
Many thanks in advance for any help with this.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: trap error from parsexlsx
by poj (Abbot) on Oct 02, 2017 at 12:38 UTC | |
|
Re: trap error from parsexlsx
by Corion (Patriarch) on Oct 02, 2017 at 09:00 UTC | |
|
Re: trap error from parsexlsx
by thanos1983 (Parson) on Oct 02, 2017 at 09:33 UTC | |
|
Re: trap error from parsexlsx
by kcott (Archbishop) on Oct 03, 2017 at 06:18 UTC | |
|
Re: trap error from parsexlsx
by Anonymous Monk on Oct 02, 2017 at 13:56 UTC |