From: Jarkko Hietaniemi Date: Sat, 11 Nov 2000 21:12:01 +0000 (+0000) Subject: Copy the s// information of README.hpux also to the perlrun. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=efdf3af0101f6674227449ca5d7f23c6fc6c46e5;p=p5sagit%2Fp5-mst-13.2.git Copy the s// information of README.hpux also to the perlrun. p4raw-id: //depot/perl@7652 --- diff --git a/README.hpux b/README.hpux index e12c60d..e850441 100644 --- a/README.hpux +++ b/README.hpux @@ -243,22 +243,22 @@ fix is currently available. =head2 perl -P and // -In HP-UX perl is compiled with flags that will cause problems if the +In HP-UX Perl is compiled with flags that will cause problems if the -P flag of Perl (preprocess Perl code with the C preprocessor before perl sees it) is used. The problem is that C, being a C++-style until-end-of-line comment, will disappear along with the remainder of the line. This means that common Perl constructs like - s/foo//; + s/foo//; will turn into illegal code - s/foo + s/foo -The workaround is to use some other quoting characters than /, -like for example ! +The workaround is to use some other quoting separator than C<"/">, +like for example C<"!">: - s!foo!!; + s!foo!!; =head1 AUTHOR diff --git a/pod/perlrun.pod b/pod/perlrun.pod index c131ad0..d532912 100644 --- a/pod/perlrun.pod +++ b/pod/perlrun.pod @@ -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>