From 879306034cb02db78a8a4cc78d40843e0830c29d Mon Sep 17 00:00:00 2001 From: dms Date: Tue, 29 Oct 2002 15:04:25 +0000 Subject: [PATCH] - patch from tim riker. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@561 c11ca15a-4712-0410-83d8-924469b57eb5 --- scripts/dbm2txt.pl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/dbm2txt.pl b/scripts/dbm2txt.pl index 0cfb10f..796a6ec 100755 --- a/scripts/dbm2txt.pl +++ b/scripts/dbm2txt.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w use strict; - +use DB_File; if (!scalar @ARGV) { print "Usage: dbm2txt \n"; print "Example: dbm2txt.pl factoids\n"; @@ -15,10 +15,11 @@ if (0) { openDB(); } -dbmopen(%db,$dbname,0444) or die "error: cannot open db.\n"; -foreach (keys %db) { +dbmopen(%db, $dbfile, 0644) or die "error: cannot open db. $dbfile\n"; +my ($key, $val); +while (($key, $val) = each %db) { next if /=>/; # skip the key if it contains the delimiter. - - print "$_ => $db{$_}\n"; + chomp $val; + print "$key => $val\n"; } dbmclose %db; -- 2.39.2