|Syntactic Confectionery Delight|
Re^3: How can I create a simple Autocad drawing with Perlby afoken (Canon)
|on Sep 29, 2019 at 19:26 UTC||Need Help??|
One of the few changes in Perl syntax now requires parentheses around all lists.When did that happen? Why would p5p give us one less way to do things while breaking an unknown number of CPAN modules? What's the point?
As others explained, it happened more or less in v5.14.0. And the cited statement "now requires parentheses around all lists" is unfortunately wrong.
To make a long story short, you now have to have parentheses where they were always required by the documentation. A parser bug allowed to omit them sometimes. You don't have to wrap all lists in parentheses. In places like use, parentheses around lists are not required and were never required.
For the details, read on.
It was a bug in the parser. qw( ... ) was wrongly parsed as (qw( ... )), and so code that omitted the parentheses was wrongly accepted as valid perl code. In 2011 / v5.14.0, using the bug was deprecated. Code that was always wrong is still wrong, and now caused warnings (see "Use of qw(...) as parentheses" in perldelta5140).
In 2012 / v5.17.0, the bug was finally fixed in the development version and caused an error (see perldelta5170). The same happened two years later, in 2013 in the stable version v5.18.0 (see perldelta5180). The parser no longer hallucinates the extra parentheses. Code that was always wrong is still wrong, but now correctly generates a syntax error complaining about missing parentheses.
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)