…and a PARtridge in a PAR tree

by Jerrad Pierce

When Mark Fowler first covered PAR in
2003, useful though it may have been, it was still quite young and not much
more than a linker for modules and scripts. The accompanying pp (now
in PAR::Packer) also allowed for the linking of the perl binary, and
therefore the distribution of a program as a stand-alone executable. Since
then a little noticed1 addition has matured.

PAR::Dist
allows one to package modules—any random module, or multiple modules
together through merge_par—for redistribution and
installation. You can thusly use PARchives as an alternative to RPMs
(or whatever your distribution uses), ActiveState's PPMs, or a
Bundle::. Some of the benefits of such a scheme are the abilities to
compile and test only once for a given platform (potentially saving a lot of
time), and to install modules without network access.

An interesting extension to PAR::Dist is
PAR::Dist::FromCPAN.
Both are usable programatically, but the latter provides the convenient
cpan2par wrapper for use from the command line. The results of

(Un)fortunately, PAR::Dist::install_par does not seem to check that
the archive platform/perl version matches/is appropriate for the target system.
On the one hand, this means you can install PARchives containing XS modules on
sufficiently similar setups without a hitch. On the other hand, it gives you
enough rope to yank out your tooth. I was able to install_par the
PARchive above on a Solaris box, though clearly not use it.