coldfingertips has asked for the wisdom of the Perl Monks concerning the following question:
Any suggestions?
#!/usr/bin/perl -w use strict; use warnings; use POSIX; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use DB_File; my %list; my $list = "mailinglist.db"; # location of database tie %list, "DB_File", "$list", O_CREAT|O_RDWR, 0644, or die "Cannot open file '$list': $!\n"; print header, start_html; my $name = param('name'); my $email = param('email'); ## Get the user information if (param) { if ($name) { if ($email) { if (exists $list{$email}) { print "<b> Email address was already found in the database. Action ca +ncelled.</b>"; } else { $list{$email} = $name; print "Thank you, $name. You will be notified of site news and websit +e updates."; } } } } foreach (keys %list) { print "$_ = > $list{$_}<br>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DB can't open
by Abigail-II (Bishop) on Dec 05, 2003 at 17:04 UTC | |
|
Re: DB can't open
by traxlog (Scribe) on Dec 05, 2003 at 19:51 UTC | |
|
Re: DB can't open
by Massyn (Hermit) on Dec 06, 2003 at 08:11 UTC |