in reply to CGI.pm Disillusionment
Suppose you've got a batch of data in an array that you want to display in an HTML list. To display it in a template you've got to create a suitable loop in your template, then assign your array data to a specially named loop variable that gets passed to your template engine. That's not that hard, but it's so much more easier for me to just my $list_var = ul(li(\@array)); and then plug $list_var into the appropriate part of my template.
Ditto with tables. If my data lends itself to the special array handling in CGI.pm it's so much easier to construct the table in code ($table = table(Tr(td(\@AoA)));) and plug the result into my template. This is ESPECIALLY true in very dynamic tables where the number of columns is not known ahead of time.
So, as always, use the parts of CGI.pm that make sense where they make sense, and leave the rest of the generation routines for when you want that quickie one-off and don't want to mess with a template.
Gary Blackburn
Trained Killer
|
---|