From: Perl 5 Porters Date: Fri, 20 Sep 1996 14:08:33 +0000 (+0100) Subject: perl 5.003_06: pod/perltrap.pod X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8b0a4b753c3f6cd8322849ab10c7b587dc42cc60;p=p5sagit%2Fp5-mst-13.2.git perl 5.003_06: pod/perltrap.pod Date: Wed, 11 Sep 1996 13:26:18 -0400 From: Gurusamy Sarathy Subject: a perl425 trap Here's an addition that should be self-explanatory. [interpolation issues] Date: Fri, 20 Sep 1996 15:08:33 +0100 (BST) From: "Joseph S. Myers" Subject: Pod typos, pod2man bugs, and miscellaneous installation comments Here is a patch for various typos and other defects in the Perl 5.003_05 pods, including the pods embedded in library modules. --- diff --git a/pod/perltrap.pod b/pod/perltrap.pod index 984ba3b..bd71ad1 100644 --- a/pod/perltrap.pod +++ b/pod/perltrap.pod @@ -69,13 +69,13 @@ executed.) See L. =item * -$> does not refer to fields--it refers to substrings matched by -the last match pattern. +$EIE does not refer to fields--it refers to substrings matched +by the last match pattern. =item * The print() statement does not add field and record separators unless -you set C<$,> and C<$.>. You can set $OFS and $ORS if you're using +you set C<$,> and C<$\>. You can set $OFS and $ORS if you're using the English module. =item * @@ -103,7 +103,7 @@ basically incompatible with C.) The concatenation operator is ".", not the null string. (Using the null string would render C unparsable, since the third slash would be interpreted as a division operator--the tokener is in fact -slightly context sensitive for operators like "/", "?", and ">". +slightly context sensitive for operators like "/", "?", and "E". And in fact, "." itself can be the beginning of a number.) =item * @@ -295,7 +295,7 @@ you might expect to do not. =item * -The construct is not the name of the filehandle, it is a readline +The EFHE construct is not the name of the filehandle, it is a readline operation on that handle. The data read is only assigned to $_ if the file read is the sole condition in a while loop: @@ -1176,6 +1176,9 @@ the file. =head2 Interpolation Traps +Perl4-to-Perl5 traps having to do with how things get interpolated +within certain expressions, statements, contexts, or whatever. + =over 5 =item * Interpolation @@ -1189,9 +1192,6 @@ the file. =item * Interpolation -Perl4-to-Perl5 traps having to do with how things get interpolated -within certain expressions, statements, contexts, or whatever. - Double-quoted strings may no longer end with an unescaped $ or @. $foo = "foo$"; @@ -1205,6 +1205,23 @@ Note: perl5 DOES NOT error on the terminating @ in $bar =item * Interpolation +Perl now sometimes evaluates arbitrary expressions inside braces that occur +within double quotes (usually when the opening brace is preceded by C<$> +or C<@>). + + @www = "buz"; + $foo = "foo"; + $bar = "bar"; + sub foo { return "bar" }; + print "|@{w.w.w}|${main'foo}|"; + + # perl4 prints: |@{w.w.w}|foo| + # perl5 prints: |buz|bar| + +Note that you can C to ward off such trappiness under perl5. + +=item * Interpolation + The construct "this is $$x" used to interpolate the pid at that point, but now apparently tries to dereference C<$x>. C<$$> by itself still works fine, however.