X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlrun.pod;h=4b86d77b51bb0ad3b19490f8895b814ea166f7bd;hb=6aa71d6ea27a640886ba2dcf7250d1be73560df8;hp=0e3017fabd5fa429df53286239386b2f53489c99;hpb=5d170f3a2f1aec382dd58400cc2a2fe1d00859b9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlrun.pod b/pod/perlrun.pod index 0e3017f..4b86d77 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -569,12 +569,39 @@ the implicit loop, just as in B. =item B<-P> -causes your program to be run through the C preprocessor before +B + +This option causes your program to be run through the C preprocessor before compilation by Perl. Because both comments and B directives begin with the # character, you should avoid starting comments with any words recognized by the C preprocessor such as C<"if">, C<"else">, or C<"define">. -Also, in some platforms the C preprocessor knows too much: it knows -about the C++ -style until-end-of-line comments starting with C<"//">. + +If you're considering using C<-P>, you might also want to look at the +Filter::cpp module from CPAN. + +The problems of -P include, but are not limited to: + +=over 10 + +=item * + +The C<#!> line is stripped, so any switches there don't apply. + +=item * + +A C<-P> on a C<#!> line doesn't work. + +=item * + +B lines that begin with (whitespace and) a C<#> but +do not look like cpp commands, are stripped, including anything +inside Perl strings, regular expressions, and here-docs . + +=item * + +In some platforms the C preprocessor knows too much: it knows about +the C++ -style until-end-of-line comments starting with C<"//">. This will cause problems with common Perl constructs like s/foo//; @@ -588,6 +615,23 @@ like for example C<"!">: s!foo!!; + + +=item * + +It requires not only a working C preprocessor but also a working +F. If not on UNIX, you are probably out of luck on this. + +=item * + +Script line numbers are not preserved. + +=item * + +The C<-x> does not work with C<-P>. + +=back + =item B<-s> enables rudimentary switch parsing for switches on the command