As the others have said, the code above has many problems. If
you just want a good working bulletin board, you should probably look
for one of the many that others have already written. If you are doing
it for a learning experience, try to post smaller portions of
code and ask about a specific problem instead of posting the entire
code and asking for "any problems."
In general, writing a good bulletin board is a tricky thing,
and can be much harder than it looks. I've written my own and it's
now at 4000 lines (and growing), and I tend to write
small, efficient code. :) Here are some things to keep in
mind when rolling your own:
- Use a database if possible. It saves a lot of trouble.
- If you can't use a database, keep the data separate from
the html files that are displayed. Keep the html out of
your code as much as possible. Break up the data into
multiple files, and create your own indexes (subsets of
your data) to allow quick accessing of the data.
- Check and double-check your file locking. This part will
really get you in trouble: since multiple processes are
writing to the same file, a simple mistake can cause your
files to be erased.
- Some sort of login/authentication will be needed eventually.
Design it that way from the beginning.
- Abstract everything as much as possible. Adding or removing
an entire table, for example, should involve changing
a configuration file and NOT the code. Things such as
the error messages, the names of the boards/threads,
the "improper language" words, etc. should not be inside
the main code itself.
- Perlmonks is a great resource,
especially for specific problems in large projects. :)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||