PAR::FAQ - Frequently Asked Questions about PAR


PAR::FAQ - Frequently Asked Questions about PAR


This is the Frequently Asked Questions list for the Perl Archive Toolkit. You can edit this document at online.


If I try to compile my wxGlade generated script, it doesn't run. What's wrong?

Comment out the line that starts with unless (caller), and compile it again. Note that this is considered a bug; clearing the caller stack is a development in progress.

I get a link error '/usr/bin/ld: cannot find -lperl' during the 'make' step of the installation on Debian. What's wrong?

This is a common problem when building compiled libraries on Debian distribution installations with the default perl package. To fix this problem, create a symbolic link from to in /usr/lib:

    cd /usr/lib; ln -s

and re-run the 'make' step of the installation.

I specify a .ico file with --icon for Win32, but the icon is still the black and white camel. What's wrong?

Unlike Perl2EXE, which can use a standard 16-color bitmap as an application icon, PAR requires a true Windows icon file. Download a trial version of [Microangelo and use that to create your .ico file. The latest Netpbm tools at has ppmtowinicon, which can tack a pbm and convert it to a windows icon. It is open source and has win32 ports.

I added a directory to my PAR file using ``zip -r'' or winzip, and then generated an executable from this PAR file, and the executable failed to run (IO error: reading header signature :..). What's wrong?

As pointed out by Alan Stewart, zip adds a directory entry for the new directory, and it causes the PAR executable to fail. Just use :

    zip -r -D hello.par my_dir/

or the Archive::Zip::addTree as follows :

    $zip->addTree( $root, $dest, sub { -f } )

On what platforms can I run PAR? On what platforms will the resulting executable run?

Win32 (95/98/ME/NT4/2K/XP), FreeBSD, Linux, AIX, Solaris, Darwin and Cygwin.

The resulting executable will run on any platforms that supports the binary format of the generating platform.

How do I extract my script out of packed executable?

In other words, ``I did a `pp' and I lost, how do I get it back?''.

The answer is to just use unzip/winzip/winrar/whatever to decompress the executable, treating it like a normal Zip file. You may need to rename the executable into a .zip extension first.

Can PAR completly hide my source code?

Not completely, but possible to a degree. Starting from version 0.76, PAR supports an input filter mechanism (see the PAR::Filter manpage), which can be used to implement source obfuscators (or even product activation schemes).

But if you are looking for 100% bulletproof way of hiding source code, it is not possible with any language. Learning Perl, 3rd Edition has this answer to offer (quoted with permission from RandalSchwartz):

    If you're wishing for an opaque binary, though, we have to tell
    you that they don't exist. If someone can install and run your
    program, they can turn it back into source code. Granted, this
    won't necessarily be the same source that you started with, but
    it will be some kind of source code. The real way to keep your
    secret algorithm a secret is, alas, to apply the proper number
    of attorneys; they can write a license that says "you can do
    this with the code, but you can't do that. And if you break our
    rules, we've got the proper number of attorneys to ensure that
    you'll regret it."


PAR, the PAR::Tutorial manpage


Autrijus Tang <> is the official PAR website. You can write to the mailing list at <>, or send an empty mail to <> to participate in the discussion.

Please submit bug reports to <>.


Copyright 2003, 2004 by Autrijus Tang <>.

This document is free documentation; you can redistribute it and/or modify it under the same terms as Perl itself.


 PAR::FAQ - Frequently Asked Questions about PAR