in reply to Re: Is tie inteded to be used in this way? Few question arise
in thread Is tie inteded to be used in this way?
@arr = undef;
is not the same as
undef @arr;
It assigns undef to the first element of the array, i.e. it's equivalent to
@arr = (undef);
Therefore, it calls CLEAR and STORE, which means two trigger calls.
$$ref = 11;
$self->SUPER::STORE($self, @_);
Remove the $self from the arguments and the problem is gone.
Update: Here's what caused the problem: when a reference is used as a number, it returns its "address" (which is good for comparing references with ==). Therefore, when you supplied $self as the first argument to STORE, it was interpreted as the index where the actual index was stored. The number was probably very high, so the array become gargantuan.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: tie example.. Code still hangs
by Discipulus (Canon) on May 01, 2015 at 16:58 UTC | |
by choroba (Cardinal) on May 01, 2015 at 19:02 UTC | |
|
Re^3: Is tie inteded to be used in this way? Few question arise
by Discipulus (Canon) on Apr 29, 2015 at 09:57 UTC |