laziness, impatience, and hubris | |
PerlMonks |
trap error from parsexlsxby gauss76 (Scribe) |
on Oct 02, 2017 at 08:59 UTC ( [id://1200508]=perlquestion: print w/replies, xml ) | Need Help?? |
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.
Back to
Seekers of Perl Wisdom
|
|