Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
code is a follows
#!/usr/bin/perl $temp = $ENV{'QUERY_STRING'}; @pairs = split(/&/, $temp); foreach $item(@pairs){ ($key, $content) = split(/=/, $item, 2); $content =~ tr/+/ /; $content=~ s/%(..)/pack("c",hex($1))/ge; $fields{$key}=$content; } print "Content-type: text/html\n\n"; #when header written here generates an error can't open #dbm file in t +he server error log. dbmopen(%users,"friends", 0666) || die "Can't open DBM file"; print "Content-type: text/html\n\n"; #when header written here generates an error premature #ending of head +ers in the server error log. if (!defined($users{$fields{'email'}})) { $users{$fields{'email'}}="$fields{'firstname'}::$fields{'lastname'}::$ +fields{'cont'}::$fields{'gender'}::$fields{'State'}::$fields'country' +}::$fields'gender'}::$fields{'age'}"; } else { print "Someone has already registered from that e-mail address. Sor +ry."; }
Edit by dws to add <code> tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: problem with creation of db file
by diotalevi (Canon) on Oct 11, 2002 at 21:57 UTC | |
|
Re: problem with creation of db file
by dorko (Prior) on Oct 12, 2002 at 02:14 UTC |