Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: same database problem

by bobn (Chaplain)
on Jul 03, 2003 at 17:04 UTC ( [id://271231]=note: print w/replies, xml ) Need Help??


in reply to same database problem

Not to be meaner than needed, but, (since this is the third time you've posted this), which part of "post a small snippet of code which demonstrates the problem" do you not understand?

update:What's meant by a small snippet that demonstrates the problem: get rid of everything except a loop that inserts the string you think is the problem into the db file, via the tied hash. If you're really using the string that causes the problem (which you should verify by some print messages in your regular program, as another poster below mentions), then the problem really is the db file or the module that ties it. And the program that demonstrates this should be about 5-10 lines long. But if youcan't reproduce it that way, then your problem is elsewhere.

Your code has the foillowing problems:

  • foreach (reverse keys (%chatorder))iterates zero times because %chatorder is empty. In your actual code there may be something there, but in the code you posted, there is not.
  • The code iterated wouldn't do anythng anyhow (except genrate a Undefined subroutine &main::td error due to no use CGI), because it contains no references to %chat or $chat{some_key}
  • On my system, the tie (%chat, , 'SDBM_File', fails without a use Fcntl;
  • The tie %chat, "Tie::IxHash"; is almost certainly meaningless due to the subsequent tie (%chat, , 'SDBM_File',
Once again, create a snippet of code that runs from the command line, and demonstrates the problem, and you have an actual chance of someone helping you.

--Bob Niederman, http://bob-n.com

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://271231]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-26 04:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found