in reply to Re^5: Database problem
in thread Database problem

Using Defined worked. Thanks. I though that was weird when it kept giving me that funky error.

Now I have a whole new error its when im trying to store data the to the db file.

Could not open /home/k0rn/data/dbapache: Resource temporarily unavailable at /home/k0rn/public_html/register.pl line 129.,

And i did do untie(%DBAPACHE); when i opened the db's in the beginning of the script. Now i get that error twoards the end of the script.Line 129 and 130 is as follows.

tie(%DBAPACHE, 'AnyDBM_File', $dbapache, 0644, O_RDWR) or die "Could not open $dbapache: $!";

$DBAPACHE{$name} = "$cryptpass:$groups:$key";

I don't see why i get that error for that code unless the 0644 needs to be something else but i don't think so.

Replies are listed 'Best First'.
Re^7: Database problem
by tachyon-II (Chaplain) on Apr 21, 2008 at 23:09 UTC

    You may need 0666 as the permissions. I presume you have shell access? It is much simpler to debug things on the command line. Try the simplified script I posted and then add a line to do what you want. I need to know which flavour of DB you are running (an the script will tell you). Run it off the command line. Once you get it to work off the command line add this to the test script

    BEGIN { $|=1; print "Content-type: text/html\n\n"; use CGI::Carp('fatalsToBrowser'); }

    and try to run it as a CGI. It should still work. If it does not it is a permissions issue. The resource temporarily unavailable makes me think something ?apache is locking the DBM file. Anyway try off the command line first, then as a CGI