From ef8bc2c5a107267f70558ea28fc4e854245ec4f8 Mon Sep 17 00:00:00 2001 From: freesource Date: Thu, 27 Jan 2005 04:05:39 +0000 Subject: [PATCH] fixed a problem where put() was putting keys and values in random places, using a normal hash fixed the probem and now --db works perfectly again. Seems to be a bug introduced with the newer berkely and DB_File since it wasn't a problem before. Solved. --- SWIM/DB.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/SWIM/DB.pm b/SWIM/DB.pm index b8f692a..034ac99 100644 --- a/SWIM/DB.pm +++ b/SWIM/DB.pm @@ -876,12 +876,19 @@ sub db { } # if defined else { dbi(\%commands); - print "$_ $db{$package_name}\n"; - $zing->put($_,$db{$package_name}); + + #$zing->put($_,$db{$package_name}); + # wow, very weird .. used to work fine, but this did the trick :) + # otherwise the key and value were placed in random places + # and never together + # inspired here - http://modperlbook.org/html/ch19_06.html + # in 19.6.2. Read/Write Access + + $ib{$_} = $db{$package_name}; } - untie %db; - untie $zing; + untie %db; + untie $zing; } # end while