Ovid has asked for the wisdom of the Perl Monks concerning the following question:
I keep getting the error message: Can't open trans.gdbm: File exists. Well, duh! I know the file exists. That's why I'm trying to read the darned thing! How the heck do I open these and read them? I took this code from the Cookbook, but obviously I've missed something.#!/usr/bin/perl -w use strict; use DB_File; my (%HASH, $key, $val); my $filename = "trans.gdbm"; tie (%HASH, "DB_File", $filename) or die "Can't open $filename: $!\n"; while (($key, $val) = each %HASH) { print "$key::$val\n"; } untie %HASH;
Thanks in advance!
Cheers,
Ovid
Great. Just great. Now everyone's going to know this level 7 Monk is a fake :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: GDBM files
by lhoward (Vicar) on Jul 25, 2000 at 03:03 UTC | |
by Ovid (Cardinal) on Jul 25, 2000 at 03:13 UTC | |
by DrManhattan (Chaplain) on Jul 25, 2000 at 22:15 UTC | |
|
RE: GDBM files
by steveAZ98 (Monk) on Jul 25, 2000 at 05:29 UTC | |
|
Re: GDBM files
by davorg (Chancellor) on Jul 25, 2000 at 11:58 UTC |