develooper Front page | perl.perl5.porters | Postings from May 2004

Re: my $x->{foo} doesn't work

Thread Previous | Thread Next
From:
Shinya Hayakawa
Date:
May 21, 2004 09:20
Subject:
Re: my $x->{foo} doesn't work
Message ID:
200405212309.28053.hayakawa@livedoor.jp
Hi,

On Friday 21 May 2004 5:47 pm, Rafael Garcia-Suarez wrote:
> If you look at what contexts permit and forbid autovivification, you'll
> see that the situation in perl is currently complex and probably not
> very consistent. Anyway, in general lvalue contexts don't permit it; a
> lexical declaration can be seen as this;

The current Perl sourcecode may incorporate a mistake in OPpDEREF
what I did before(like OPpLVAL_INTRO).

> and you still can write, in a 
> rather obfuscated way,
>
>     (my $x = {}) -> {foo}

What you proposed is exactly what I have been doing but
there is nothing I can do apart from the above :-)

If this is successful I will rather prefer to write as follows:

++my $x->{foo} if cond();
...


-- 
Shinya Hayakawa
hayakawa@livedoor.jp

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