Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: .pl to .exe

by snadra (Scribe)
on Sep 03, 2003 at 13:35 UTC ( #288630=note: print w/ replies, xml ) Need Help??


in reply to .pl to .exe

There is a tool called perl2exe, wich does what you are asking for, for windows and Unix. But I cannot tell you how good it is, since I never used it.


Comment on Re: .pl to .exe
Re: Re: .pl to .exe
by bart (Canon) on Sep 03, 2003 at 14:33 UTC
    Or Activestate's PerlApp, which basically does the same thing. Though, do only use this as a mechanism to ease installation, not as a way to hide your source, or even speed up your code. I think you can just open the executable in a hex editor or even a plain text editor, and just read the source.

    Pod-Browser and The GUI Loft are two examples of applications that can be downloaded in binary form. At least perl2exe does some encryption of the source, though as you can read in "perl2exe - no more secrets", it is easily broken.

    You might reconsider using PAR or maybe even tinyperl instead.

    p.s. AFAIK perlcc has been abandoned because of insurmountable problems. It didn't give any speed improvement anyway. So, don't use it.

Re: Re: .pl to .exe
by Anonymous Monk on Sep 03, 2003 at 21:34 UTC
    As a current Perl2Exe user I thought I might add my 2 cents to this discussion by doing a side by side comparison of the two compile methods. Now, before I go too far, I must say I just started playing with PAR today, so I'm not exactly an expert on using it. I'm sure there are better ways of using it to compile scripts, but this method seemed like the best way at the time.

    For starters, I use Perl2Exe mostly to create single EXE files (command line and GUI) for some of my users on Win32 boxes that don't require Perl, dependencies, or anything extra be installed. Adding Perl to each user's machine and synchronizing modules with everyone would not be worth the effort. One Application, one file. I really could care less about the fact that the embedded code is encrypted. Perl2Exe also provides the ability to compile your script for other platforms like Linux and Sun provided you have a $449 enterprise license. Not needing to port my scripts to other platforms, I could care less. So, for what I use it for, the $49 version Perl2Exe works just fine for me except when I sometimes need to create GUI apps. To get rid of that annoying command line window I could get the $149 version or just use another Perl script to flip the command line/windows app bit in the finished executable I pulled off this web site (sorry, can't remember the name, but it's here somewhere in a Perl2exe message thread). Since most of my scripts are command line based, I really donít need to do that much. That said, let's move on.

    For the first test I took one of my old scripts that grabs scanned LEGO manuals off of the Brickshelf site at http://www.brickshelf.com by sego set number. It's a small, ~3K script that uses LPW to do the actual fetch of the JPG scans. Here's the compile results:
    C:\TOOLS\Perl>perl2exe legoscanfetch.pl Perl2Exe V5.03b Copyright (c) 1997-2002 IndigoSTAR Software [reg code removed] Converting 'legoscanfetch.pl' to legoscanfetch.exe C:\TOOLS\Perl>pp -o legoscanfetch.par.exe legoscanfetch.pl C:\TOOLS\Perl>pp -B -p legoscanfetch.pl C:\TOOLS\Perl>dir legoscanfetch.* Volume in drive C is drive label Volume Serial Number is 0566-16E9 Directory of C:\TOOLS\Perl 09/03/2003 04:39p 1,059,664 legoscanfetch.exe 09/03/2003 04:42p 300,618 legoscanfetch.par 09/03/2003 04:41p 1,499,944 legoscanfetch.par.exe 09/03/2003 04:36p 3,445 legoscanfetch.pl 4 File(s) 2,863,671 bytes 0 Dir(s) 13,508,353,536 bytes free C:\TOOLS\Perl>
    As you can see the Perl2exe version is a bit smaller. Just as a test, I moved both files over to another Win2k box that did not have Perl installed and ran them. Both worked, proving that the compiled executables were completely self contained. As for the PAR file, that's just in there for a size reference. Since it's not a completely self contained executable I'm not really interested in it, but this may be of interest to someone else.

    Now, on to the next test. For this I decided to see how well PAR could handle external DLLs. For a while I've been playing with WxPerl. I like it, but Perl2Exe does not seem to bundle the Wx DLLs into the executable by default. There's probably a way to do this, but I haven't bothered to look. For this test, I used one of the sample files included with WxPerl that just pops up a GUI window. To keep it simple, I opted to not get rid of the command line window that the compiled executable creates. Here's the compile results for the second test:
    C:\TOOLS\Perl\tests>perl2exe wx_sample.pl Perl2Exe V5.03b Copyright (c) 1997-2002 IndigoSTAR Software [reg code removed] Converting 'wx_sample.pl' to wx_sample.exe C:\TOOLS\Perl\tests>pp -o wx_sample.par.exe wx_sample.pl C:\TOOLS\Perl\tests>pp -B -p wx_sample.pl C:\TOOLS\Perl\tests>dir wx_sample.* Volume in drive C is drive label Volume Serial Number is 0566-16E9 Directory of C:\TOOLS\Perl\tests 09/03/2003 05:02p 2,328,374 wx_sample.exe 09/03/2003 05:05p 3,426,203 wx_sample.par 09/03/2003 05:03p 4,625,518 wx_sample.par.exe 05/30/2003 02:25p 1,448 Wx_Sample.pl 4 File(s) 10,381,543 bytes 0 Dir(s) 13,497,361,408 bytes free C:\TOOLS\Perl\tests>
    In this case, Perl2exe looks to be the clear winner in this case until you realize that the compiled executable requires three Wx DLLs to function. Not so bad you may say, that is until you see the size of the DLLs:
    C:\TOOLS\Perl\tests>dir *.dll Volume in drive C is drive label Volume Serial Number is 0566-16E9 Directory of C:\TOOLS\Perl\tests 05/30/2003 02:31p 1,124,352 Wx.dll 08/04/2002 04:41a 2,301,440 wx22_9.dll 05/19/2003 02:49p 3,225,600 wxmsw241.dll 3 File(s) 6,651,392 bytes 0 Dir(s) 13,494,103,040 bytes free C:\TOOLS\Perl\tests>
    And yes, all three DLLs are required for it to run, I checked. The PAR version worked without them (or with them depending on how you look at it). So, it looks like the 4.5M PAR version is the clear winner in the embedded DLL test.

    I'd ramble on a bit more, but this is getting a bit long, so I'll continue this in another post. Next test: benchmarks!

    Rick

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://288630]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2014-12-26 16:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (172 votes), past polls