Commenting out unlink "chat"; would probably help too...Update: I meant in addition to sauoq's comment, not instead of. | [reply] [d/l] |
He's just doing that once at the beginning of the script to remove his old file before writing a new one. That shouldn't matter (as long as he wants to start fresh each time the script runs.)
Update: jsprat is correct. The file should not be unlinked. (It is obvious, on closer inspection, that the script is useless without it.)
-sauoq
"My two cents aren't worth a dime.";
| [reply] |
I don't think he wants to start fresh each time. He wants to save the data so he can display more than one line.
It looks like a CGI script that wants to accept a line of chat, then display the previous 10 lines. What it actually does is this:
- deletes all previous messages
- creates the db file, ties %chat
- unties %chat, thereby not storing any messages
- accepts a new message
- displays the last 10 messages (which were just deleted!)
Not only is the %chat untied from the the DB_File when it's tied to TIE::IxHash (as you pointed out), the script is deleting the DB_File every time it is hit.
| [reply] |
Then what do you suggest? I need to tie %chat to Tie::IxHash to retain insertion order and I need tie it to the DB_File or it's useless.
"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 | [reply] |
-sauoq
"My two cents aren't worth a dime.";
| [reply] |
| [reply] |