X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlrun.pod;h=d53291270c9898534a8646a3bba83f413d274dc9;hb=7817ba4dfeb754838a0da8f159127895c2dcf4fc;hp=d8fb12c9be89a1dbd119efe3eeb96a69ecc1c90e;hpb=3bbcc830de5b39568997aa65d260ed9901f3098a;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlrun.pod b/pod/perlrun.pod index d8fb12c..d532912 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -311,7 +311,7 @@ equivalent to B<-Dtls>): 8 t Trace execution 16 o Method and overloading resolution 32 c String/numeric conversions - 64 P Print preprocessor command for -P + 64 P Print preprocessor command for -P, source file input state 128 m Memory allocation 256 f Format processing 512 r Regular expression parsing and execution @@ -569,9 +569,23 @@ the implicit loop, just as in B. =item B<-P> causes your program to be run through the C preprocessor before -compilation by Perl. (Because both comments and B directives begin +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 "if", "else", or "define".) +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<"//">. +This will cause problems with common Perl constructs like + + s/foo//; + +because after -P this will became illegal code + + s/foo + +The workaround is to use some other quoting separator than C<"/">, +like for example C<"!">: + + s!foo!!; =item B<-s>