in reply to Need help with badwords routine
Also, since there is no "use CGI" (or use of any CPAN modules), and instead there are several "require" statements for (presumably) home-grown chunks of code, I'm assuming this thing was originally written for Perl 4. Would you consider refactoring the code so that it takes advantage of Perl 5 and CPAN (e.g. at least CGI, and possibly something like HTML::Template)?
Also, since you are using regex substitutions to highlight "bad" words, I wonder if the problem might be related to the particular data associated with the current script / web-site, rather than with the code. People using current perl modules and methods do not use regex substitutions for this sort of editing. HTML::Parser or something built on top of that (e.g. HTML::TokeParser or others) would be a safer, less brittle approach. But again, that entails a fairly drastic refactoring/rewrite of the current code.
(I googled "cgi-lib.perl" -- at least it doesn't appear to be the infamous "Matt's Scripts", but it looks to be about 10 years old. Time for an update, don't you think? Esp. considering that some of the content at http://cgi-lib.berkeley.edu/, which purports to be the "cgi-lib.pl home page", appears to have vanished, for instance the stuff that was linked to "CGI Security" -- not a good sign...)
(updated to fix typo in first paragraph)
|
|---|