in reply to Re: Dumping Tie Objects
in thread Dumping Tie Objects

I think (perhaps more knowledgeable monks can confirm) that the  FIRSTKEY function needs to be defined such that it always returns the first key of the hash. As it is, it's the same as  NEXTKEY and only returns the first key upon the first iteration or when iteration wraps around to the beginning again.

Try (untested):

sub FIRSTKEY { my ($self) = @_; scalar keys %$Self; return each %{ $self->{'value'} }; }
Update: keys resets the internal iterator of a hash. In void context, this happens with no other overhead, so the use of scalar above is only for the purpose of self-documentation.

Also: On second thought, I would be inclined to implement  FIRSTKEY in terms of  NEXTKEY (also untested):

sub FIRSTKEY { my ($self) = @_; keys %$Self; return $self->NEXTKEY; }