develooper Front page | perl.perl6.language | Postings from October 2001

Berkeley Help

Thread Next
From:
Phil Daws
Date:
October 16, 2001 08:49
Subject:
Berkeley Help
Message ID:
4C9FC83D0891C343A0D480B3DAC304FC07C9DB@server.office.local
Hi:

I have a HASH file that contains :

domain1.co.uk	ACCEPT
domain2.co.uk	ACCEPT
domain3.co.uk	ACCEPT

I am using the following code to check that a key exists. The problem is
that it never finds it! What am I doing wrong???

-----------------------------------------------------------------
$file = "/file.db";
$db = tie(%stats, "DB_File", "$file", O_CREAT|O_RDWR, 0666, $DB_HASH) ||
die ("Cannot open $file");

$key = 'domain1.co.uk';

print "Exists\n" if exists $stats{$key};

untie %stats ;

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About