You haven't stored anything in the hash yet, so $_[0]->{val}->{one} returns undef, which isn't an lvalue.sub FETCH { my($s, $k) = (shift, shift); return exists( $s->[0]{$k} ) ? $s->[2][ $s->[0]{$k} ] : undef; }
Suggested and untested solution: $h {one} = undef after the tie.
Abigail
In reply to Re: lvalue trickery
by Abigail-II
in thread lvalue trickery
by broquaint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |