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

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

Thread Previous | Thread Next
Shinya Hayakawa
May 21, 2004 09:20
Re: my $x->{foo} doesn't work
Message ID:

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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About