in reply to Re: Database storage confusion
in thread Database storage confusion
The code that works for me is actually $dbm{$name} = "";, it's the only one that does what I want. You can test the script itself from what I posted below.
#!/usr/bin/perl -W use strict; use warnings; use POSIX; use CGI; require SDBM_File; my %dbm; my $test = "test.dbm"; tie (%dbm, 'SDBM_File', $test, O_CREAT|O_RDWR, 0644) || die "Died tying database\nReason: $!\n"; print "Aaron's Phonebook System\n\n\n"; print "What is their name?\n"; my $name = $_; #if ($name ne "") { chomp($name = <STDIN>); $dbm{$name} = ""; print "Added to the list!\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Database storage confusion
by demerphq (Chancellor) on Mar 09, 2003 at 15:38 UTC | |
by sulfericacid (Deacon) on Mar 10, 2003 at 04:11 UTC | |
by demerphq (Chancellor) on Mar 10, 2003 at 08:15 UTC | |
|
Re: Re: Re: Database storage confusion
by Cody Pendant (Prior) on Mar 09, 2003 at 06:38 UTC |