SergioQ has asked for the wisdom of the Perl Monks concerning the following question:
Am trying to read an Excel spreadsheet using Spreadsheet::Read
I've done everything to confirm the file exists, and is a valid file. I've set the file and its directories all to 777. I've downloaded the file from my server to my desktop and verified that it opens up in Excel.
But in the code below, I am falling when I eval the ReadData method.
Where I'm stuck is that other that failing on the eval, I don't know if or how to get further data on why Spreadsheet::Read fails with trying to open my spreadsheet.
If anyone has any experience using this module, I'd appreciate any help.
Thank you.
$filename = "R202406181844029040.xlsx" if ($testMode); my ($ext) = "$upload_dir/$filename" =~ /(\.[^.]+)$/; $ext =~ s/\.//g; $ext =~ s/^\s+|\s+$//g; my $book; my $upFilename = "$upload_dir/$filename"; $logger->debug("entering eval with $upFilename "); if (-e $upFilename) { $logger->debug("file exists"); } else { $logger->debug("file DOES NOT exists"); } eval { $book = ReadData ("$upFilename"); 1; } or do { ...handle error here };
|
|---|