diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1996-09-20 15:08:33 +0100 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-09-20 15:08:33 +0100 |
commit | 8b0a4b753c3f6cd8322849ab10c7b587dc42cc60 (patch) | |
tree | 6f2043b89a5127c67ef1546f9edae2c2c976c559 /pod/perltrap.pod | |
parent | 55703d846f4330df36df26f4c56ca9863dba637e (diff) | |
download | perl-8b0a4b753c3f6cd8322849ab10c7b587dc42cc60.tar.gz |
perl 5.003_06: pod/perltrap.pod
Date: Wed, 11 Sep 1996 13:26:18 -0400
From: Gurusamy Sarathy <gsar@engin.umich.edu>
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" <jsm28@hermes.cam.ac.uk>
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.
Diffstat (limited to 'pod/perltrap.pod')
-rw-r--r-- | pod/perltrap.pod | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/pod/perltrap.pod b/pod/perltrap.pod index 984ba3b5b1..bd71ad17a2 100644 --- a/pod/perltrap.pod +++ b/pod/perltrap.pod @@ -69,13 +69,13 @@ executed.) See L<perlvar>. =item * -$<I<digit>> does not refer to fields--it refers to substrings matched by -the last match pattern. +$E<lt>I<digit>E<gt> 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</pat/ /pat/> 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<gt>". And in fact, "." itself can be the beginning of a number.) =item * @@ -295,7 +295,7 @@ you might expect to do not. =item * -The <FH> construct is not the name of the filehandle, it is a readline +The E<lt>FHE<gt> 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<use strict;> 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. |