Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

In reply to Re: Re: .pl to .exe by Anonymous Monk
in thread .pl to .exe by andrew2003

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-25 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found