Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Why don't Win32::MemMap or Tie::Win32MemMap work with perl2exe or PAR/pp?

by keszler (Priest)
on Aug 05, 2004 at 05:28 UTC ( #380190=categorized question: print w/replies, xml ) Need Help??
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:

my $MemMapDLL=$Config{installsitearch}."\\auto\\Win32\\MemMap\\memmap. +dll";

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:

my $MemMapDLL=".\\MemMap.dll";

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.

Answer: Why don't Win32::MemMap or Tie::Win32MemMap work with perl2exe or PAR/pp?
contributed by mikeock

With the new version of perl2exe(Ver8.70), it allows you to use an include option when compiling. The syntax is as follows: #perl2exe_include modulename.

I don't know if this would resolve the above issue for sure. As far as I can tell it forces the module to be included into the program and I believe it changes the module load location to within the program than from an external directory.

Please (register and) log in if you wish to add an answer



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    [LanX]: imagine the stock market if the choice for the second round would have been those two ...
    [robby_dobby]: LanX: Not me. No YAPC in my country and the only one in Asia is so far off in Japan
    [LanX]: Oh I thought "Misery" meant Missoury
    [LanX]: where do you live?
    [LanX]: YAPC Asia was renamed and you'd need to speak Japanese to be able to follow
    [robby_dobby]: LanX: Misery :P
    [robby_dobby]: Or India
    LanX which means I can finally organize YAPC Asia in Sharm el Sheikh ;-)
    [robby_dobby]: I attended a couple conferences (both in India). Left me with a renewed enthusiasm to do more, only to see it disappear in a few days!
    [LanX]: Then come to YAPC EU in Amsterdam ...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (12)
    As of 2017-04-24 15:57 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      I'm a fool:











      Results (442 votes). Check out past polls.