in reply to
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. :)