diff options
author | Nicholas Clark <nick@ccl4.org> | 2000-09-28 18:12:42 +0100 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-10-02 23:50:40 +0000 |
commit | c26893538723a2740afe1c2f89ea22856818835b (patch) | |
tree | 3f31b016b79a4f40ad97051f4cdac747a6ca07d0 /pod/perldata.pod | |
parent | 5675c1a6395a0842c857fc8de159747577df6c4b (diff) | |
download | perl-c26893538723a2740afe1c2f89ea22856818835b.tar.gz |
Document the issue (is not a syntax error, kind of)
Subject: Re: [ID 20000901.011] the list (1,,3) ought to be a syntax error
Message-ID: <20000928171242.K7924@plum.flirble.org>
p4raw-id: //depot/perl@7116
Diffstat (limited to 'pod/perldata.pod')
-rw-r--r-- | pod/perldata.pod | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/pod/perldata.pod b/pod/perldata.pod index 65689a6056..50b685816e 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -540,6 +540,15 @@ has no effect. Thus ((),(),()) is equivalent to (). Similarly, interpolating an array with no elements is the same as if no array had been interpolated at that point. +This interpolation combines with the facts that the opening +and closing parentheses are optional (except necessary for +precedence) and lists may end with an optional comma to mean that +multiple commas within lists are legal syntax. The list C<1,,3> is a +concatenation of two lists, C<1,> and C<3>, the first of which ends +with that optional comma. C<1,,3> is C<(1,),(3)> is C<1,3> (And +similarly for C<1,,,3> is C<(1,),(,),3> is C<1,3> and so on.) Not that +we'd advise you to use this obfuscation. + A list value may also be subscripted like a normal array. You must put the list in parentheses to avoid ambiguity. For example: |