|Syntactic Confectionery Delight|
Why don't Win32::MemMap or Tie::Win32MemMap work with perl2exe or PAR/pp?
Contributed by keszler
on Aug 05, 2004 at 05:28 UTC
Q&A > programs and processes
Description:OK - this probably isn't a frequently asked question, but maybe it'll save someone the frustration I just went through.
Line #60 of MemMap.pm is:
perl2exe and pp dutifully include the memmap.dll in the .exe they create. perl2exe with -tiny copies memmap.dll to the program's directory. The problem is, with the hardcoded path in memmap.pm it doesn't get used.
The compiled program will run just fine on any system with Perl and Win32::MemMap installed, but fail with the unhelpful error message 'Can't call method "Call" on an undefined value at Win32/Memmap.pm line 111.' on any other PC.
A solution for perl2exe with -tiny is to edit memmap.pm, replacing line 60 with:
to make the compiled program check it's own directory for the .dll. An alternate solution would be to use whatever temp directory perl2exe or pp use.
Also, the use Config; line in memmap.pm can be commented out: line 60 was the only reason for it.
Please (register and) log in if you wish to add an answer