in reply to error dereferencing array in a tied hash

Show us your STORE and FETCH subs. Maybe there's a problem there that you've missed.

  • Comment on Re: error dereferencing array in a tied hash

Replies are listed 'Best First'.
Re: Re: error dereferencing array in a tied hash
by Anonymous Monk on Sep 29, 2001 at 21:38 UTC

    They won't make much sense on their own since they call out to other code, but here they are anyway. As I noted, I've put print statements in and FETCH has the correct value right at return time. That value is only returned if I assign it, as also noted -- not as a dereference on the hash element FETCH is operating on behalf of.

    sub FETCH { my $self = shift; my $key = shift; my $value = $self->{USER_OPT}->direct_get($key, $self->{ATTRS}); return $value; } sub STORE { my $self = shift; my $key = shift; my $value = shift; my $name; ($name, $value) = $self->{USER_OPT}->direct_set($key, $value, $self->{ATTRS}); return $value; }