On Jul 1, 2013, at 5:52 AM, Ruslan Zakirov <ruz@bestpractical.com> wrote: > > > > On Sun, Jun 16, 2013 at 11:31 PM, Father Chrysostomos <sprout@cpan.org> wrote: > > On Jun 16, 2013, at 11:47 AM, Ruslan Zakirov <ruz@bestpractical.com> wrote: > > I want to reject most lvalue operations: > > > > 1) %h{a} = ... as well as %h{qw(a b)} = ... should throw an error > > > > 2) I think lvalue subs should too as it's assignment > > $ ./perl -Ilib -le '$_ = "hello"; (sub : lvalue { %{{"hello" => 2}}{$_} }->()) = 3; print $_' > 3 > > Can I check during compile time that an op is used as return value of a lvalue sub? LVRET is runtime thing. Can not find example in the code. A pointer or a list of flags to look at? Look for OPpMAYBE_LVSUB in op.c:op_lvalue_flags. Without that flag, LVRET always returns 0 at run time.Thread Previous | Thread Next