in reply to HTML In CGI Scripts.
Putting the HTML outputting code in a subroutine is the first step. If you've gotten this far, you probably realize that HTML interspersed with code can get pretty nasty. But eventually, you will need functionality more complex than just variable substitution into your HTML skeleton. At this point, instead of reinventing this very common wheel, learning a templating system will save you a lot of grief. There are several good ones out there.
And if you ever get serious about CGI scripts (as in, coding for money), you will eventually be working with designers. Take it from me, you do NOT want them opening your Perl code to tweak some HTML!
blokhead
|
|---|