in reply to lvalues in perl prior to 5.16.3 throws "Can't modify reference constructor in lvalue subroutine return"
I wouldn't expect this to work, ( well it does in 5.14 see update 2)
You may try creating a temporary named sub with lvalue and pass the reference, but I'm not sure about implementation details and side effects.
Since when are lvalue subs allowed to use return ?
was able to test now and 5.14 allows anonymous lvalue subs, but return won't work.
perl -e' $z=10; $x=sub :lvalue { $z}; (&$x)=42; print &$x; ' 42
maybe try to further isolate the problem...
|
|---|