I use the perl DB_File module to save the hash variable to a file.
My hash variable contains the key as a normal string and the value as another hash variable.
I used Storable::freeze(\%value); to serialize the hash value.
But when I tried to get the values, I got an error. The first time I run the recovery code, it works. The next time he fails.
I used this method:
tie(%HASH, "DB_File", "dbfile", O_RDWR, 0444); foreach $key (%HASH) { $hashRef = Storable::thaw($HASH{$key}; --> here it fails with the error }
Error message
The saved binary image v25.47 is more recent than me (v2.7) in .. /../lib/Storable.pm (auto-extension in .. /../lib/auto/Storable/thaw.al) line 366, in line retrieve.pl 15 on the page .. /../lib/Storable.pm(auto reset in .. /../lib/auto/Storable/logcroak.al) line 74 Storable :: logcroak (''), called at .. /../lib/Storable.pm(autocompletion in .. /../lib/auto/Storable/thaw.al) line 367 Storable :: thaw ('2/8'), called on the line retrieve .pl 15
source share