I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2007-04-30 10:36:39-07 by bosh
how to trap error when parsing corrupted xls file
please help, since I can't find anywhere on how to solve the problem I create a bullet proof script to read xls file because my project will allow users to post any excel file to our web then process the xls to html. problem came when we test to post using corrupted excel file. sure, ms excel 2003 can detect the corrupted file and try to recover the file easily, but not the Spreadsheet-ParseExcel module
$fExcel = Spreadsheet::ParseExcel->new; $wBook = $fExcel->Parse($filename); #parse xls file -> hang on here
it just hang when try to parse, thus forced me to use ctrl-c to stop it is there anyway to trap this kind of error? I need to solve the problem otherwise I can't open the web to public ps: i'm using Win32 Perl
Direct Responses: 5065 | 7226 | 13795 | Write a response
Posted on 2007-05-07 06:07:24-07 by bosh in response to 5019
Re: how to trap error when parsing corrupted xls file
I got temporary solver just use php module "read xls file", it will generate error after 30 sec time out reading such a corrupted xls file I wonder why that complex perl modules doesn't have some advanced error trapping like php? I still use the perl modules because it far advanced than the php modules the php modules just for testing reading xls purposes only anybody have similar problem?
Direct Responses: 5094 | Write a response
Posted on 2007-05-09 04:33:44-07 by bosh in response to 5065
Re: how to trap error when parsing corrupted xls file
because combining php and perl could lead you into complicated problem (as I did)
ones giving me simple solver, just use time out (alarm) feature

local $SIG{ALRM} = sub { die("TIMED OUT") }; eval { alarm(20); #set our alarm for 20 seconds $wBook = $fExcel->Parse($filename); #parse xls file alarm(0); }; if ( $@ =~ /TIMED OUT/ ) { print "file $filename load error! time out on processing, could be corrupt!\n"; goto ended; }; not_ended_runs_here: ....

it solved my problem!
it uses same concept as php module which I try before, that php module also use timeout feature too
Direct Responses: Write a response
Posted on 2008-02-29 05:16:42-08 by fyz in response to 5019
Re: how to trap error when parsing corrupted xls file
Hi, I think you can try a popular Excel file recovery tool called Advanced Excel Repair to repair your Excel file. It is a powerful tool to repair corrupt or damaged Excel files. Detailed information about Advanced Excel Repair can be found at http://www.datanumen.com/aer/ And you can also download a free demo version at http://www.datanumen.com/aer/aer.exe Alan
Direct Responses: Write a response
Posted on 2012-08-28 23:42:03.683014-07 by michal101 in response to 5019
Re: how to trap error when parsing corrupted xls file
excel sheet is very important document for those user who use to maintain the report on excel sheet. It is very reliable and effective and also easy to use sheet that can easily manage and easily prepaired. But sometime it can be damage or corruted due to any kind of infection. Then you have to repair it with the help of xls repair software. It is very easy to use and easily available and also protect your further damage. For more information:- http://www.xlsxrepair.com
Direct Responses: Write a response