diff options
author | Casey West <casey@geeknest.com> | 2003-05-09 07:09:39 -0400 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2003-05-09 19:34:30 +0000 |
commit | 418272e4394459ff8d3580f3ac6ed7225c26fa9a (patch) | |
tree | 8881a2ee399e72e987b39d1a33b36f7de7770712 /pod | |
parent | d3989d752d99f59d5b497f1becb9bfd9c9469b96 (diff) | |
download | perl-418272e4394459ff8d3580f3ac6ed7225c26fa9a.tar.gz |
[perl #8702] Clean up perltrap mis-information
Message-ID: <20030509150939.GN49820@geeknest.com>
p4raw-id: //depot/perl@19464
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perltrap.pod | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pod/perltrap.pod b/pod/perltrap.pod index d06f84ff80..835f879949 100644 --- a/pod/perltrap.pod +++ b/pod/perltrap.pod @@ -1435,13 +1435,26 @@ perl4 programs which unconsciously rely on the bugs in earlier perl versions. =item * Interpolation -You also have to be careful about array references. +You also have to be careful about array and hash brackets during +interpolation. + + print "$foo[" + + perl 4 prints: [ + perl 5 prints: syntax error print "$foo{" perl 4 prints: { perl 5 prints: syntax error +Perl 5 is expecting to find an index or key name following the respective +brackets, as well as an ending bracket of the appropriate type. In order +to mimic the behavior of Perl 4, you must escape the bracket like so. + + print "$foo\["; + print "$foo\{"; + =item * Interpolation Similarly, watch out for: |