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
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.