NAME
B::C - Perl compiler's C backend
SYNOPSIS
perl -MO=C[,OPTIONS] foo.pl
DESCRIPTION
This compiler backend takes Perl source and generates C source code corresponding to the internal structures that perl uses to run your program. When the generated C source is compiled and run, it cuts out the time which perl would have taken to load and parse your programinto its internal semi-compiled form. That means that compiling with
this backend will not help improve the runtime execution speed of yourprogram but may improve the start-up time. Depending on the environ-
ment in which your program runs this may be either a help or a hin-
drance. OOPPTTIIOONNSSIf there are any non-option arguments, they are taken to be names of
objects to be saved (probably doesn't work properly yet). Without extra arguments, it saves the main program.-ooffiilleennaammee
Output to filename instead of STDOUT-vv Verbose compilation (currently gives a few compilation statistics).
-- Force end of options
-uuPPaacckknnaammee
Force apparently unused subs from package Packname to be compiled. This allows programs to use eval "foo()" even when sub foo is never seen to be used at compile time. The down side is that any subs which really are never used also have code generated. This option is necessary, for example, if you have a signal handler foo whichyou initialise with "$SIG{BAR} = "foo"". A better fix, though, is
just to change it to "$SIG{BAR} = \&foo". You can have multiple -uu
options. The compiler tries to figure out which packages may possi-
bly have subs in which need compiling but the current version doesn't do it very well. In particular, it is confused by nestedpackages (i.e. of the form "A::B") where package "A" does not con-
tain any subs.-DD Debug options (concatenated or separate flags like "perl -D").
-DDoo OPs, prints each OP as it's processed
-DDcc COPs, prints COPs as processed (incl. file & line num)
-DDAA prints AV information on saving
-DDCC prints CV information on saving
-DDMM prints MAGIC information on saving
-ff Force options/optimisations on or off one at a time. You can
explicitly disable an option using -ffnnoo-ooppttiioonn. All options default
to ddiissaabblleedd.-ffccoogg
Copy-on-grow: PVs declared and initialised statically.
-ffssaavvee-ddaattaa
Save package::DATA filehandles ( only available with PerlIO ).-ffppppaaddddrr
Optimize the initialization of opppaddr.-ffwwaarrnn-ssvv
Optimize the initialization of copwarnings.-ffuussee-ssccrriipptt-nnaammee
Use the script name instead of the program name as $0.
-ffssaavvee-ssiigg-hhaasshh
Save compile-time modifications to the %SIG hash.
-OOnn Optimisation level (n = 0, 1, 2, ...). -OO means -OO11.
-OO00 Disable all optimizations.
-OO11 Enable -ffccoogg.
-OO22 Enable -ffppppaaddddrr, -ffwwaarrnn-ssvv.
-lllliimmiitt
Some C compilers impose an arbitrary limit on the length of string constants (e.g. 2048 characters for Microsoft Visual C++). The-lllliimmiitt options tells the C backend not to generate string literals
exceeding that limit. EEXXAAMMPPLLEESSperl -MO=C,-ofoo.c foo.pl
perl ccharness -o foo foo.c
Note that "ccharness" lives in the "B" subdirectory of your perl library directory. The utility called "perlcc" may also be used to help make use of this compiler.perl -MO=C,-v,-DcA,-l2048 bar.pl > /dev/null
BUGS
Plenty. Current status: experimental. AUTHOR Malcolm Beattie, "mbeattie@sable.ox.ac.uk"perl v5.8.8 2001-09-21 B::C(3pm)