Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Convert to exe

by metronomu (Initiate)
on Oct 07, 2011 at 13:09 UTC ( [id://930177]=perlquestion: print w/replies, xml ) Need Help??

metronomu has asked for the wisdom of the Perl Monks concerning the following question:

Hello all, i have the following problem, i want to convert a perl script to a executable but it's harder than quantum physics. My script uses XML::LibXML and if i convert using pp it gives a error when trying to parse a XML file by saying "can't locate XML\LibXML\SAX.pm in @INC. I managed to bypass this error by explicitly including this file using -m "path to module". But when i run the executable it says "Program too big to fit in memory" which can't be a real issue since the exe has 3 MB and i have a bazillion RAM. It drives me nuts, i lost a lot of time with this issue, i tried a lots of fantasy ideas because i have no more options. It would be really helpful if someone could help. BTW , the script uses XML::Simple which i guess needs the XML::LibXML package since i don't include anywhere XML::LibXML.

Replies are listed 'Best First'.
Re: Convert to exe
by marto (Cardinal) on Oct 07, 2011 at 13:50 UTC

    "BTW , the script uses XML::Simple which i guess needs the XML::LibXML package since i don't include anywhere XML::LibXML."

    There's no need to guess, check the dependencies.

    "But when i run the executable it says "Program too big to fit in memory" which can't be a real issue since the exe has 3 MB and i have a bazillion RAM."

    Perhaps there's something fundamentally wrong with your code. Post a small example of your code which reproduces the problem, any test data (some XML? Give details on the file size you're dealing with etc) and your pp command which you use to generate the exe.

Re: Convert to exe
by Limbic~Region (Chancellor) on Oct 07, 2011 at 14:05 UTC
    metronomu,
    I am not sure if this will be a viable solution due to the cost, but I recently paid for the Active State Perl Dev Toolkit. Here are a list of reasons I went with this solution:
    • I can cross compile to Windows, 32/64 bit Linux and Mac OS X
    • I can use the license on any of the OSes listed above
    • There is commercial support if I run into issues
    • I can write off the cost as an operational expense on my taxes
    • I can deliver a single executable file to a client who doesn't need to worry about installing anything
    • I can convert the application into a windows service if desired

    This is the first time since I have been using Perl that I decided it was a good idea to pay for this (having survived on free alternatives before now) but I am very glad I made the decision.

    Cheers - L~R

Re: Convert to exe
by pvaldes (Chaplain) on Oct 07, 2011 at 13:34 UTC

    Probably Perl is not the way I will use to create an closed binary .exe, but you can appreciate this post and take a look to perl2exe...

    In any case as we don't have code to see, we probably can't figure out the real problem here

      Thx for reply, there's no need of posting the source code , as script it runs fine so it's not a problem from the code(i think), what's even more harder to understand it's that the SAME script worked as executable a few months ago (i could build the exe without problem). The only difference between now and then is that as far as i can remember i installed Windows again(yes, it's Windows) and that means that i also installed a new version of Perl. My distribution is Strawberry Perl. I know i could search for a older distribution but that's a kind of a compromise solutuion, i will do this as a last instance.
Re: Convert to exe
by exilepanda (Friar) on Oct 07, 2011 at 14:34 UTC
    You can have a trial version of PDK from ActiveState ( as Limbic~Region mentioned ) and test if you can compile not, there's a gui with some debug logic, so maybe easier to identify that's the code problem, or the conversion problem

    Just a big guess ( was my experience ), did you reading some important variables from files? which maybe ignored when converting to executable, because the packer won't read into your file and elaborate a desired var to move on. HTH

Re: Convert to exe
by Anonymous Monk on Oct 08, 2011 at 11:11 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://930177]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (6)
As of 2024-04-16 09:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found