If you're doing the CGI.pm thing.. or using the 'cgi-lib.pl' library (old.. but nice) then subs are the way to go. The biggest single advantage is that maintaining the code is easier. You change one sub to reflect the change across the entire HTML output.
Not sure where I read it, but someone said that if you're going to repeat a line of once even once you should put it into a sub (or function.. or whatever). It makes sense I suppose.
Another alternative would be to put the HTML into strings and print them, but thats almost the same thing.
Chris
$live{$free}||die
In reply to Re: Effective ways to 'write' html.
by onion2k
in thread Effective ways to 'write' html.
by zigster
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |