1PAR(1)                User Contributed Perl Documentation               PAR(1)
2
3
4

NAME

6       par.pl - Make and run Perl Archives
7

SYNOPSIS

9       (Please see pp for convenient ways to make self-contained executables,
10       scripts or PAR archives from perl programs.)
11
12       To make a PAR distribution from a CPAN module distribution:
13
14           % par.pl -p                 # make a PAR dist under the current path
15           % par.pl -p Foo-0.01        # assume unpacked CPAN dist in Foo-0.01/
16
17       To manipulate a PAR distribution:
18
19           % par.pl -i Foo-0.01-i386-freebsd-5.8.0.par # install
20           % par.pl -i http://foo.com/Foo-0.01         # auto-appends archname + perlver
21           % par.pl -i cpan://AUTRIJUS/PAR-0.74        # uses CPAN author directory
22           % par.pl -u Foo-0.01-i386-freebsd-5.8.0.par # uninstall
23           % par.pl -s Foo-0.01-i386-freebsd-5.8.0.par # sign
24           % par.pl -v Foo-0.01-i386-freebsd-5.8.0.par # verify
25
26       To use Hello.pm from ./foo.par:
27
28           % par.pl -A./foo.par -MHello
29           % par.pl -A./foo -MHello    # the .par part is optional
30
31       Same thing, but search foo.par in the @INC;
32
33           % par.pl -Ifoo.par -MHello
34           % par.pl -Ifoo -MHello      # ditto
35
36       Run test.pl or script/test.pl from foo.par:
37
38           % par.pl foo.par test.pl    # looks for 'main.pl' by default,
39                                       # otherwise run 'test.pl'
40
41       To make a self-containing script containing a PAR file :
42
43           % par.pl -O./foo.pl foo.par
44           % ./foo.pl test.pl          # same as above
45
46       To embed the necessary non-core modules and shared objects for PAR's
47       execution (like "Zlib", "IO", "Cwd", etc), use the -b flag:
48
49           % par.pl -b -O./foo.pl foo.par
50           % ./foo.pl test.pl          # runs anywhere with core modules installed
51
52       If you also wish to embed core modules along, use the -B flag instead:
53
54           % par.pl -B -O./foo.pl foo.par
55           % ./foo.pl test.pl          # runs anywhere with the perl interpreter
56
57       This is particularly useful when making stand-alone binary executables;
58       see pp for details.
59

DESCRIPTION

61       This stand-alone command offers roughly the same feature as "perl
62       -MPAR", except that it takes the pre-loaded .par files via "-Afoo.par"
63       instead of "-MPAR=foo.par".
64
65       Additionally, it lets you convert a CPAN distribution to a PAR
66       distribution, as well as manipulate such distributions.  For more
67       information about PAR distributions, see PAR::Dist.
68
69   Binary PAR loader (parl)
70       If you have a C compiler, or a pre-built binary package of PAR is
71       available for your platform, a binary version of par.pl will also be
72       automatically installed as parl.  You can use it to run .par files:
73
74           # runs script/run.pl in archive, uses its lib/* as libraries
75           % parl myapp.par run.pl     # runs run.pl or script/run.pl in myapp.par
76           % parl otherapp.pl          # also runs normal perl scripts
77
78       However, if the .par archive contains either main.pl or script/main.pl,
79       it is used instead:
80
81           % parl myapp.par run.pl     # runs main.pl, with 'run.pl' as @ARGV
82
83       Finally, the "-O" option makes a stand-alone binary executable from a
84       PAR file:
85
86           % parl -B -Omyapp myapp.par
87           % ./myapp                   # run it anywhere without perl binaries
88
89       With the "--par-options" flag, generated binaries can act as "parl" to
90       pack new binaries:
91
92           % ./myapp --par-options -Omyap2 myapp.par   # identical to ./myapp
93           % ./myapp --par-options -Omyap3 myap3.par   # now with different PAR
94
95   Stand-alone executable format
96       The format for the stand-alone executable is simply concatenating the
97       following elements:
98
99       •   The executable itself
100
101           Either in plain-text (par.pl) or native executable format (parl or
102           parl.exe).
103
104       •   Any number of embedded files
105
106           These are typically used for bootstrapping PAR's various XS
107           dependencies.  Each section contains:
108
109           The magic string ""FILE""
110           Length of file name in "pack('N')" format plus 9
111           8 bytes of hex-encoded CRC32 of file content
112           A single slash (""/"")
113           The file name (without path)
114           File length in "pack('N')" format
115           The file's content (not compressed)
116       •   One PAR file
117
118           This is just a zip file beginning with the magic string
119           ""PK\003\004"".
120
121       •   Ending section
122
123           The pre-computed cache name.  A pack('Z40') string of the value of
124           -T (--tempcache) or the hash of the file, followed by "\0CACHE".
125           The hash of the file is calculated with Digest::SHA.
126
127           A pack('N') number of the total length of FILE and PAR sections,
128           followed by a 8-bytes magic string: ""\012PAR.pm\012"".
129

SEE ALSO

131       PAR, PAR::Dist, parl, pp
132

AUTHORS

134       Audrey Tang <cpan@audreyt.org>, Steffen Mueller <smueller@cpan.org>
135
136       You can write to the mailing list at <par@perl.org>, or send an empty
137       mail to <par-subscribe@perl.org> to participate in the discussion.
138
139       Please submit bug reports to <bug-par-packer@rt.cpan.org>.
140
142       Copyright 2002-2009 by Audrey Tang <cpan@audreyt.org>.
143
144       Neither this program nor the associated parl program impose any
145       licensing restrictions on files generated by their execution, in
146       accordance with the 8th article of the Artistic License:
147
148           "Aggregation of this Package with a commercial distribution is
149           always permitted provided that the use of this Package is embedded;
150           that is, when no overt attempt is made to make this Package's
151           interfaces visible to the end user of the commercial distribution.
152           Such use shall not be construed as a distribution of this Package."
153
154       Therefore, you are absolutely free to place any license on the
155       resulting executable, as long as the packed 3rd-party libraries are
156       also available under the Artistic License.
157
158       This program is free software; you can redistribute it and/or modify it
159       under the same terms as Perl itself.
160
161       See LICENSE.
162
163
164
165perl v5.36.0                      2022-12-02                            PAR(1)
Impressum