If you have a problem please post the actual error messages, they really help!

What am I doing wrong?

1) Hand parsing your form data. use CGI or die; You could replace all your initial code with:

use CGI; use CGI::Carp 'fatalsToBrowser'; # this will make debugging easier my $q = new CGI; my $userIP = $q->remote_host; # get REMOTE_HOST my %rawData = $q->Vars(); # get CGI data as a hash

2) When you do your dbmopen you should have something like this (a)full path to file and (b) possibly the 0666 option. Note at the CL you script will run with your permissions so 0600 on the allIPs db file should be OK. Under CGI it will run as user 'nobody' so you need R/W for everybody so chmod 666 allIPs (606 should also do)

my %allIPs; dbmopen( %allIPs, "/full/path/to/database/allIPs", 0666 ) or die "Cannot open allIPs database: $!"; $allIPs{$userIP} = $dbEntry or die "$!"; dbmclose %allIPs;

3) Not reporting or perhaps even looking for error messages. With a CGI you often need to look in the server logs or write a die_nice() function. CGI Help Guide

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: dbm troubles by tachyon
in thread dbm troubles by Guildencrantz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.