in reply to Re: Re: Database still overwriting itself
in thread Database still overwriting itself

After looking through your code a little more thoroughly, I see that $notverified and $verified are never defined. So if you remove the single quotes, you get an error. If you leave them, you are creating the keys named for your variables. And don't get me started on your logic behind this...
  • Comment on Re: Re: Re: Database still overwriting itself

Replies are listed 'Best First'.
Re: Re: Re: Re: Database still overwriting itself
by sulfericacid (Deacon) on Feb 16, 2003 at 05:22 UTC
    Why are neither of them defined? I set $dbm{'$notverified'}= join "::",@unverified_emails; and $dbm{$verified} to another database varible. Thanks

    "Age is nothing more than an inaccurate number bestowed upon us at birth as just another means for others to judge and classify us"

    sulfericacid

      First, let me say that you still are not taking rdfield's advice from Re: Database not storing data.

      I'm only going to talk about the following line of code:
      $dbm{'$notverified'}= join "::",@unverified_emails;
      I leave it up to you to learn from this and rewrite the rest of your script.

      This joins the elements of @unverified_emails into a string seperated by double colons. It stores that string in $dbm{'$notverified'}. Let me rephrase that, you are storing the newly created string in the database file in a key called $notverified. I should stress that the key name is literally $notverified and not a variable referring to another key name. I reiterate; '$notverified' is a literal string. Why? Because it is wrapped in single quotes. Single quotes do not interpolate variables like double quotes do. So every time that this script is run, you will be overwriting the old data in $dbm{'$notverified'} with the new data.