Aristotle Pagaltzis <pagaltzis <at> gmx.de> writes: >>you can start >>out with a working program, comment out lines of code one at a time, >>and then arrive at a syntax error when the number of statements in the >>block reaches 0. > >But similar cases exist for hash construction. As long as the syntax is >ambiguous you can only trade some surprising cases in the block case for >some surprising cases in the hash case, But the syntax is not ambiguous. In C<{} sub foo {}> there can be no doubt that the first {} is a code block and not a hash constructor. If you try taking it as a hash constructor you get a syntax error. The problem is that Perl's parser jumps one way based on a heuristic and then isn't smart enough to try the other possibility. -- Ed Avis <eda@waniasset.com>Thread Previous