summaryrefslogtreecommitdiff
path: root/pod/perltodo.pod
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2008-10-01 08:55:48 +0000
committerNicholas Clark <nick@ccl4.org>2008-10-01 08:55:48 +0000
commit565590b5d66dafeef2ec402e8f2aecb5e1fc2a60 (patch)
treefa092a151d955664c8a4a2b93a7ffbc9ffaad455 /pod/perltodo.pod
parent049aaf37de4ebebcfcfe544e014d51c23d56fd89 (diff)
downloadperl-565590b5d66dafeef2ec402e8f2aecb5e1fc2a60.tar.gz
error reporting of [$a ; $b] can be a TODO.
p4raw-id: //depot/perl@34451
Diffstat (limited to 'pod/perltodo.pod')
-rw-r--r--pod/perltodo.pod17
1 files changed, 17 insertions, 0 deletions
diff --git a/pod/perltodo.pod b/pod/perltodo.pod
index 7a1a48a6b8..558921ce77 100644
--- a/pod/perltodo.pod
+++ b/pod/perltodo.pod
@@ -845,6 +845,23 @@ also the warning messages (see L<perllexwarn>, C<warnings.pl>).
These tasks would need C knowledge, and knowledge of how the interpreter works,
or a willingness to learn.
+=head2 error reporting of [$a ; $b]
+
+Using C<;> inside brackets is a syntax error, and we don't propose to change
+that by giving it any meaning. However, it's not reported very helpfully:
+
+ $ perl -e '$a = [$b; $c];'
+ syntax error at -e line 1, near "$b;"
+ syntax error at -e line 1, near "$c]"
+ Execution of -e aborted due to compilation errors.
+
+It should be possible to hook into the tokeniser or the lexer, so that when a
+C<;> is parsed where it is not legal as a statement terminator (ie inside
+C<{}> used as a hashref, C<[]> or C<()>) it issues an error something like
+I<';' isn't legal inside an expression - if you need multiple statements use a
+do {...} block>. See the thread starting at
+http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2008-09/msg00573.html
+
=head2 lexicals used only once
This warns: