None of the code uses -T, -Mstrict, or -w. Furthermore, most of it is written in a manner like this:
instead ofprint <<'HTML"; <html> <head><title>Email This Article to a Friend</title></head> <center> <b>The following fields are missing or inproperly filled </b> + </center> <p> <hr> error_fields <p> <hr> <p> Please use the <b>back</b> button on your browser to return and comple +te the form. </body> <html> HTML
The scripts (around 200 or so) are littered with HTML, and filehandles that point to html files in various directories (with special variable names and the like which are s///'d in at compile time).sub error_mf_page { print header, start_html( "Email This Article to a Friend" ), p( {-align => 'center'}, b( "The following fields are missing or improperly filled" +) ), p(), hr(), "@error_fields", p(), hr(), p(), "Please use the", b( " back " ), "button on your browser to return and complete the form.", end_html; }
This code is so unmaintainable it makes me ill to work in it. I was originally brought in to write some new programs, and add some functionality, as well as diagnose and test some problems they were having. The deeper you look, the more problems you see. You cant just go in and actually write new code, because it takes you four hours to figure out what the current code is actually doing.
So my question for the monastery then is, is there actually any advantage to writing code like this? To embedding html into perl scripts rather than using it the way its supposed to be (i.e., perl is perl, html is html, keep them separate)? The code is written by good programmers, they have a firm concept of the way programming is done. But they lack any organized and consistent style, and to quote the senior developer, "I forget how it works, but as long as it works, thats the way it is." Did I miss the class on lapse-of-ethics when I was learning programming in college?
Has anyone else gone through a massive code-audit like this?
thanks
brother dep.
--
Laziness, Impatience, Hubris, and Generosity.
In reply to Why use HTML instead of CGI? (code, discussion) by deprecated
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |