in reply to lvalues in perl prior to 5.16.3 throws "Can't modify reference constructor in lvalue subroutine return"

Works for in all versions I've tried, and I tried as far back as 5.8.8.

Test:

perl -MTie::Scalar -le' sub make { return sub :lvalue { tie my $tied, "Tie::StdScalar"; return $tied; } } my $f = make(); $f->() = 4; '

If you beg to differ, please provide code that demonstrates the problem. What you posted doesn't run.

  • Comment on Re: lvalues in perl prior to 5.16.3 throws "Can't modify reference constructor in lvalue subroutine return"
  • Download Code

Replies are listed 'Best First'.
Re^2: lvalues in perl prior to 5.16.3 throws "Can't modify reference constructor in lvalue subroutine return"
by hurricup (Pilgrim) on Jan 23, 2015 at 05:38 UTC

    Thanks to everyone for answers.

    The problem is that at home i've got only win7 and production FreeBSD with modern perl versions. Perlbrew don't want to work at my win machine.

    Today i've installed few virtualboxes with other oses, will try there on the weekend.

    All fails i know are coming from CPANTESTERS, including os and perl versions.

    I'll let you know about my further investigation of this issue.

    btw, are bugs fixed in 5.16 are still present in prior perl versions?