This cause is "The \$ prototype accepts any scalar lvalue" in perl 5.16.
http://perldoc.perl.org/perl5160delta.html#Other-Changes
Your code seems not using \$ prototype.
Could you try a code below with Perl >= 5.16 and < 5.16:
perl -MData::Dumper -e 'sub t(\[$@%]@) { warn Dumper(\@_) }; t(my @a = qw(foo bar));'
$ ~/perlbrew/perls/perl-5.14.4/bin/perl -MData::Dumper -e 'sub t(\[$@%]@) { warn Dumper(\@_) }; t(my @a = qw(foo bar));'
Type of arg 1 to main::t must be one of [$@%] (not list assignment) at -e line 1, near "qw(foo bar))"
Execution of -e aborted due to compilation errors.
# This is desirable behavior
$ ~/perlbrew/perls/perl-5.16.3/bin/perl -MData::Dumper -e 'sub t(\[$@%]@) { warn Dumper(\@_) }; t(my @a = qw(foo bar));'
$VAR1 = [
\2
];
# No error...
and check source code of Readonly.
https://metacpan.org/source/ROODE/Readonly-1.03/Readonly.pm#L338
On 2013-6月-12 水 11:51:36, SPROUT wrote:
Show quoted text> On Wed Jun 12 06:02:10 2013, HIROSE wrote:
> > 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.
> >
http://perldoc.perl.org/perl5160delta.html#Other-Changes
> >
> > I know wrong usage of Readonly is bad, but I hope it wll be syntax
> > error with perl >= 5.16.
>
> I hadn’t realised it would have that effect. I wonder whether this
> should also be a syntax error:
>
> $ echo aosenuthaeosuhtse | perl -le 'read STDIN, @a=qw(foo bar), 10;
> print for @a'
> foo
> bar
>
> That is longstanding behaviour (tested with 5.12).