Bug#655063: syntax error not caught ($h+=9)=(3)

jidanni at jidanni.org jidanni at jidanni.org
Sun Jan 8 08:01:39 UTC 2012


Package: perl
Version: 5.14.2-6
Severity: wishlist

The first syntax error is caught, but not the next, even with use strict.

$ perl -lwe '($h{a}+ 9,$h{f})=(3,2); print for values %h'
Can't modify addition (+) in list assignment at -e line 1, near ");"
Execution of -e aborted due to compilation errors.
$ perl -lwe '($h{a}+=9,$h{f})=(3,2); print for values %h'
3
2
$ perl -lwe 'use strict;my %h;($h{a}+=9,$h{f})=(3,2); print for values %h'
3
2
$ perl -lwe 'use strict;my $h;($h+=9,undef)=(3,2); print $h'
3
$ perl -lwe 'use strict;my $h;($h+=9)=(3); print $h'
3

If it is not a syntax error then it should be.






More information about the Perl-maintainers mailing list