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

Hi All, I am using "par" module for making "exe" file from my perl scripts. Us +ually the size of the exe file is so big. I want to compress the exe +file size. Is it possible, what can I do for this? Regards, Srikrishnan

Replies are listed 'Best First'.
Re: Compress exe file size
by Anonymous Monk on Jun 20, 2009 at 07:21 UTC
    mod:/pp
    -z, --compress=NUMBER

    Set zip compression level; NUMBER is an integer from 0 to 9, 0 = no compression, 9 = max compression. Defaults to 6 if -z is not used.

    PAR::Filter::PodStrip
    pp -z 9 -f PodStrip foo.pl
      Hi, Thanks for your immediate reply. I have a perl script. when I convert using the following command: pp -gui -o xmpPDF1.exe xmpPDF.pl the resulted exe file size is "3,664 KB" when I use, as per you said: pp -gui -z 9 -o xmpPDF2.exe xmpPDF.pl the resulted exe file size is "3,657 KB" So it only reduced "7 bit". But when I create exe using "perlapp.exe", the size is very minimum ap +proximately 500 to 700 KB only. Can I make it reduce the exe size in such highly compressed way? REgards, Srikrishnan

        The difference is that pp generates a standalone application containing everything your script needs, including the entire perl interpreter and all required DLLs, whereas perlapp just wraps your script and a stub that loads the existing perl interpreter. The pp-generated EXE runs on a computer without perl, the perlapp-generated one doesn't.

        Choose what you need: If the target computer has your perl version installed, use perlapp. If it doesn't, use pp. Or even better: Distribute the raw script and a perl installer.

        (And by the way: The difference is not 7 bit, but 7 KBytes = 7 * 1024 Bytes * 8 Bit / Byte = 57.344 bits.)

        Alexander

        --
        Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)