perlquestion
keszler
Win32::MemMap
Tie::Win32MemMap
perl2exe
PAR
pp
Win32/Memmap.pm
OK - this probably isn't a <b>frequently</b> asked question, but maybe it'll save someone the frustration I just went through.<p>
Line #60 of MemMap.pm is:<p>
<code>
my $MemMapDLL=$Config{installsitearch}."\\auto\\Win32\\MemMap\\memmap.dll";
</code>
<p>
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.<p>
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.<p>
A solution for perl2exe with -tiny is to edit memmap.pm, replacing line 60 with:
<code>
my $MemMapDLL=".\\MemMap.dll";
</code>
<p>
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.<p>
Also, the <code>use Config;</code> line in memmap.pm can be commented out: line 60 was the only reason for it.
<p><i>Originally posted as a Categorized Question. </i></p>