summaryrefslogtreecommitdiff
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
parentb29a8fb934f89ae86dc789c5763065c077e692f8 (diff)
downloadperl-efdf3af0101f6674227449ca5d7f23c6fc6c46e5.tar.gz
Copy the s// information of README.hpux also to the perlrun.
p4raw-id: //depot/perl@7652
-rw-r--r--README.hpux12
-rw-r--r--pod/perlrun.pod18
2 files changed, 22 insertions, 8 deletions
diff --git a/README.hpux b/README.hpux
index e12c60d352..e850441095 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 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>