1PERLCC(1) Perl Programmers Reference Guide PERLCC(1)
2
3
4
6 perlcc - generate executables from Perl programs
7
9 $ perlcc hello # Compiles into executable 'a.out'
10 $ perlcc -o hello hello.pl # Compiles into executable 'hello'
11
12 $ perlcc -O file # Compiles using the optimised C backend
13 $ perlcc -B file # Compiles using the bytecode backend
14
15 $ perlcc -c file # Creates a C file, 'file.c'
16 $ perlcc -S -o hello file # Creates a C file, 'file.c',
17 # then compiles it to executable 'hello'
18 $ perlcc -c out.c file # Creates a C file, 'out.c' from 'file'
19
20 $ perlcc -e 'print q//' # Compiles a one-liner into 'a.out'
21 $ perlcc -c -e 'print q//' # Creates a C file 'a.out.c'
22
23 $ perlcc -I /foo hello # extra headers (notice the space after -I)
24 $ perlcc -L /foo hello # extra libraries (notice the space after -L)
25
26 $ perlcc -r hello # compiles 'hello' into 'a.out', runs 'a.out'.
27 $ perlcc -r hello a b c # compiles 'hello' into 'a.out', runs 'a.out'.
28 # with arguments 'a b c'
29
30 $ perlcc hello -log c # compiles 'hello' into 'a.out' logs compile
31 # log into 'c'.
32
34 perlcc creates standalone executables from Perl programs, using the
35 code generators provided by the B module. At present, you may either
36 create executable Perl bytecode, using the "-B" option, or generate and
37 compile C files using the standard and 'optimised' C backends.
38
39 The code generated in this way is not guaranteed to work. The whole
40 codegen suite ("perlcc" included) should be considered very experimen‐
41 tal. Use for production purposes is strongly discouraged.
42
44 -Llibrary directories
45 Adds the given directories to the library search path when C code
46 is passed to your C compiler.
47
48 -Iinclude directories
49 Adds the given directories to the include file search path when C
50 code is passed to your C compiler; when using the Perl bytecode
51 option, adds the given directories to Perl's include path.
52
53 -o output file name
54 Specifies the file name for the final compiled executable.
55
56 -c C file name
57 Create C code only; do not compile to a standalone binary.
58
59 -e perl code
60 Compile a one-liner, much the same as "perl -e '...'"
61
62 -S Do not delete generated C code after compilation.
63
64 -B Use the Perl bytecode code generator.
65
66 -O Use the 'optimised' C code generator. This is more experimental
67 than everything else put together, and the code created is not
68 guaranteed to compile in finite time and memory, or indeed, at all.
69
70 -v Increase verbosity of output; can be repeated for more verbose out‐
71 put.
72
73 -r Run the resulting compiled script after compiling it.
74
75 -log
76 Log the output of compiling to a file rather than to stdout.
77
78
79
80perl v5.8.8 2008-05-05 PERLCC(1)