Use of qw(...) as parentheses: deprecated in 5.14, removed in 5.18

Niko Tyni ntyni at debian.org
Sat May 11 14:04:08 UTC 2013


Hi Dominic,

do you still happen to have the rebuild logs from 5.14 around?

My first tentative rebuild tests turned up a couple of build failures
(libfile-libmagic-perl_0.96-3, libfile-mmagic-xs-perl_0.09006-4)
because of this (from 5.18.0-RC1 perldelta.pod):

   qw(...) can no longer be used as parentheses
       "qw" lists used to fool the parser into thinking they were
       always surrounded by parentheses.  This permitted some surprising
       constructions such as "foreach $x qw(a b c) {...}", which should
       really be written "foreach $x (qw(a b c)) {...}".  These would
       sometimes get the lexer into the wrong state, so they didn't
       fully work, and the similar "foreach qw(a b c) {...}" that one
       might expect to be permitted never worked at all.

       This side effect of "qw" has now been abolished.  It has been
       deprecated since Perl v5.13.11.  It is now necessary to use real
       parentheses everywhere that the grammar calls for them.

The 5.14 build logs of these packages have the warning
 Use of qw(...) as parentheses is deprecated
so bugs could be filed based on just grepping for that.

It looks like those two packages have the error in bundled helper code
(inc/Module/Install/XSUtil.pm, inc/Devel/CheckLib.pm) so this may be
a more common problem. Both Module-Install-XSUtil and Devel-CheckLib
themselves have since been fixed.
-- 
Niko




More information about the Perl-maintainers mailing list