Thread

Posted on Mon Apr 23 01:44:57 2007 by luna
error when creating executable with Spreadsheet::ParseExcel

I frequently use perl2exe to create perl-based executables that I can use at work without having to install Perl on every workstation. It just makes it simplier and portable.

My current project is more complex than previous scripts. This script uses Spreadsheet::ParseExcel to access spreadsheet information and uses the resulting data to move hundreds of files between directories. Specifically the script parses an Excel file and takes only the Cell->{Val} data from each cell in the spreadsheet. Further, each cell within the spreadsheet is strictly text. This implies I don't need the full range of capabilities of ParseExcel but so far it's the best tool for the job by far (many thanks to the developers).

The script works fine when using the Perl interpreter but I encounter an error at runtime after the executable is created using Perl2exe and/or PAR.

Error =

"Couldn't load any math lib, not even 'Calc.pm' at Perl2EXE_STORAGE/OLE/STORAGE_LITE.pm line 13. BEGIN failed--compliation aborted at PERL2EXE_Storage/OLE/Storage_Lite line 13. BEGIN failed--compliation aborted at PERL2EXE_Storage/Spreadsheet/ParseExcel.pm line 176"

Line 13 of Storage_Lite is simply:

use Math::BigInt;

Line 176 of ParseExcel appears to be a reference to a hash. The first use of the Storage_Lite module occurs a few lines later.

All modules have been installed with PPM.

Has anyone ever come across this problem before or have any potential solutions?

I think the problem is with Math:BigInt. Even this simple program below fails when I try to run the executable created with Perl2exe.

use strict; use warnings; use Math::BigInt; print "okfine";

The executable is created but it displays the same error as above sans the message about ParseExcel. When use Math::BigInt is replaced with require Math::BigInt; the resulting executable is ok. This does not work when the Storage_Lite reference is changed to require Math::BigInt however.

Any help you can shed would be appreciated.

philc

Direct Responses: 4989 | 4990 | 4998 | 7886 | Write a response
Posted on Wed Apr 25 19:58:57 2007 by neilbryant in response to 4968
Re: error when creating executable with Spreadsheet::ParseExcel
Came here, searching for exactly the same thing. Based on what you did, I expanded to the following:
use OLE::Storage_Lite; require Math::BigInt; #perl2exe_include "Math/BigInt.pm"; #perl2exe_include "Math/BigInt/Calc.pm"; #perl2exe_include "Math/BigInt/FastCalc.pm";

and my app compiles. since this is my first perl app, i'm not going to pretend to know how much of that is necessary . . . but it works. I'll cull things out later, but this might get you going.

hth,

(btw, philc, I think I know you, IRL?)

dart
Write a response
Posted on Wed Apr 25 22:45:09 2007 by neilbryant in response to 4968
Re: error when creating executable with Spreadsheet::ParseExcel
Came here, searching for exactly the same thing. Based on what you did, I expanded to the following:
use OLE::Storage_Lite; require Math::BigInt; #perl2exe_include "Math/BigInt.pm"; #perl2exe_include "Math/BigInt/Calc.pm"; #perl2exe_include "Math/BigInt/FastCalc.pm";

and my app compiles. since this is my first perl app, i'm not going to pretend to know how much of that is necessary . . . but it works. I'll cull things out later, but this might get you going.

hth,

(btw, philc, I think I know you, IRL?)

dart
Write a response
Posted on Fri Apr 27 03:24:35 2007 by neilbryant in response to 4968
Re: error when creating executable with Spreadsheet::ParseExcel
Came here, searching for exactly the same thing. Based on what you did, I expanded to the following:
use OLE::Storage_Lite; require Math::BigInt; #perl2exe_include "Math/BigInt.pm"; #perl2exe_include "Math/BigInt/Calc.pm"; #perl2exe_include "Math/BigInt/FastCalc.pm";

and my app compiles. since this is my first perl app, i'm not going to pretend to know how much of that is necessary . . . but it works. I'll cull things out later, but this might get you going.

hth,

(btw, philc, I think I know you, IRL?)

dart
Write a response
Posted on Thu May 15 17:26:32 2008 by lansky243 in response to 4968
Re: error when creating executable with Spreadsheet::ParseExcel
You must include this into the script you are compiling:
#perl2exe_include Math::BigInt::Calc;
I had put it before the library loading so the final code looked likes like this:
#Perl2Exe #perl2exe_include Math::BigInt::Calc; use strict; use Spreadsheet::WriteExcel; use Spreadsheet::ParseExcel::Simple;
Afterthat I was able to compile it with perl2exe without any problem. L243
Write a response