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

Hello , I was looking at options to build a Perl exe. I found PAR to be of my liking as its free. I tried Perl2exe, PerlApp but they are not free. There is a free version of Perl2exe available but it gives some 2 seconds delay in the exe.

But the strange thing i noticed in almost all of them is that even for simple program they build a huge output file. Just for example i tested it on a simple hello world program with strict and warnings pragmas included , it outputs a file of 1.5 MB.

I have a requirement to build a exe for a program with XML::Simple & other modules included. In fact XML::Simple itself requires lots of other modules. so i was worried what size of output it will produce. Can you all tell me is there a simpler way to build exe which produces somewhat less heavt output files.

Rgds, Neeraj.

Replies are listed 'Best First'.
Re: PAR creating an exe very large in size
by gellyfish (Monsignor) on Aug 10, 2005 at 13:56 UTC

    If you want smaller executables use a different language - such as assembler. The problem with creating executables from Perl is that you have to include the "perl runtime" i.e. nearly all of perl itself and there really isn't any way of getting around this.

    /J\

Re: PAR creating an exe very large in size
by Happy-the-monk (Canon) on Aug 10, 2005 at 14:00 UTC

    your local perl.exe will always be part of your executable packaged by PAR.

    I take it that those 1.5 mb is the net weight, now by adding things like a few modules it needn't grow too much bigger. Best you try it!

    Cheers, Sören

Re: PAR creating an exe very large in size
by holli (Abbot) on Aug 10, 2005 at 16:03 UTC
    The biggest part of that output file is the perlXX.dll where XX stands for the version. For me that would be the file perl58.dll with 785 KB.

    I know that PerlApp has the ability to "compile" scripts without the dll. But then of course the target computer must have the dll installed, but only once. I'm pretty sure that PAR has a similar option.


    holli, /regexed monk/
      yup, PAR has it too (from pp docs):
      d, --dependent
      
          Reduce the executable size by not including a copy of perl interpreter. Executables
          built this way will need a separate perl5x.dll or libperl.so to function correctly.
          This option is only available if perl is built as a shared library.