First, I do plan to introduce CGI::Carp.
I recommend that the people take the course learn to use the CGI.pm HTML functions for several reasons:
- If they work on anyone else's CGI scripts, they are likely to encounter them sooner or later, so they should know them.
- Because CGI.pm is creating your HTML for you, it provides a rough syntax check of the HTML. You can't get that with a here doc or with HTML::Template.
- You can't forget to close your tags (why, just today I fixed a table that someone forgot the closing table tag. Too bad for Netscape).
- It's tough for them to decide if they like these functions if they never use them.
I plan to introduce a variety of methods of creating the HTML, so that people taking the course can see the pros and cons of different methods (TIMTOWTDI). It's tough to evaluate something you have never used. I hate multiple
print statements and a here document is not much better. Obviously, for large sites, mixing code and HTML is a nightmare. At the very least, the HTML functions are code as opposed to markup tags. I won't demand that the people taking the course use any one method, but I will ask that they at least be familiar with them.
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just go the the link and check out our stats.