develooper Front page | perl.perl5.porters | Postings from June 2013

Re: key/value hash and index/valuse array slices syntax

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
June 16, 2013 19:31
Subject:
Re: key/value hash and index/valuse array slices syntax
Message ID:
B75EEB06-7BD6-459B-A7BA-E64C6EC2279E@cpan.org

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


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About