[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: exists $foo[7] and delete $foo[7]



>IIRC, the current documentation says it will be fixed in a future
>release.

My copy reads:

    This surprising autovivification in what does not at first--or
    even second--glance appear to be an lvalue context may be fixed
    in a future release.

This is *not* related to exists().  You have to make all uses of
the pointer arrow dereference, implicit or explicit, stop autovivifying.

    $x[$i][$j] += $y[$i][$j] if $z[$i][$j] < 10;

That will autovivify three things.  Your task, if you choose to
accept it, it to make it autovivify but two of them.  But there are
a lot of other border situations to consider.  Here's one:

    $x[$i][$j] =~ s/foo/bar/;   
or
    $x[$i][$j] =~ s/^//;   		# how no-op-py is this *really*?

And then there's this fun one:

    somefunc( $x[$i][$j] );


--tom


Follow-Ups from:
Larry Wall <larry@wall.org>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]