|Subject:||Readonly @a = qw(foo bar) is not a syntax error with perl >= 5.16|
I often mistake using Readonly. wrong : Readonly @a = qw(foo bar); correct: Readonly @a => qw(foo bar); Wrong code cause syntax error until Perl 5.14: $ ~/perlbrew/perls/perl-5.14.4/bin/perl -MReadonly -e 'Readonly my @a = qw(foo bar); warn "hey!"' Type of arg 1 to Readonly::Readonly must be one of [$@%] (not list assignment) at -e line 1, near "qw(foo bar);" Execution of -e aborted due to compilation errors. but no error from Perl 5.16: $ ~/perlbrew/perls/perl-5.16.3/bin/perl -MReadonly -e 'Readonly my @a = qw(foo bar); warn "hey!"' hey! at -e line 1. I suppose this cause is "The \$ prototype accepts any scalar lvalue" in perl 5.16.I know wrong usage of Readonly is bad, but I hope it wll be syntax error with perl >= 5.16.