summaryrefslogtreecommitdiff
path: root/pod/perlrun.pod
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-11-11 21:12:01 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-11 21:12:01 +0000
commitefdf3af0101f6674227449ca5d7f23c6fc6c46e5 (patch)
tree40bbbe104da899f6396d21cb7f0693ece1518bda /pod/perlrun.pod
parentb29a8fb934f89ae86dc789c5763065c077e692f8 (diff)
downloadperl-efdf3af0101f6674227449ca5d7f23c6fc6c46e5.tar.gz
Copy the s// information of README.hpux also to the perlrun.
p4raw-id: //depot/perl@7652
Diffstat (limited to 'pod/perlrun.pod')
-rw-r--r--pod/perlrun.pod18
1 files changed, 16 insertions, 2 deletions
diff --git a/pod/perlrun.pod b/pod/perlrun.pod
index c131ad0d70..d53291270c 100644
--- a/pod/perlrun.pod
+++ b/pod/perlrun.pod
@@ -569,9 +569,23 @@ the implicit loop, just as in B<awk>.
=item B<-P>
causes your program to be run through the C preprocessor before
-compilation by Perl. (Because both comments and B<cpp> directives begin
+compilation by Perl. Because both comments and B<cpp> 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>