But I think the heart of your problem is here:
and hereprint FH Data::Dumper->Dump([\%data], ['*data']);
This line sets the $ret value to be equal to the glob *data which was just overwritten by you. (ok, so you ignore the $ret and use the global var \%data, but that was just overwritten so... Same dif.) So its the copy semantics in the _write and _read subs that are causing you trouble. Change them to use scalar refs and not globs and the problem will go away. Oh and lose the shallow copy in _read its misleading and unnecessary.my $ret = do $file
UPDATE
A question: Why are you mixing proper method calls and procedural calls? _write() is a method, but you call it as a procedure. This means it wont be overidable in a subclass...
sub DESTROY { _write ($_[0]) } #not overidable!
Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.
In reply to Re: Tie-ing hashes clobbers data
by demerphq
in thread Tie-ing hashes clobbers data
by Dave05
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |