http://qs321.pair.com?node_id=169726

Hi all,

I am adventuring in the world of perl and web based applications, and I stumbled upon a very important matter regarding which way HTML (or your output of choice) is to be printed: via inline PRINT (something with vars... ENDHTML is surely better) or via TEMPLATE reading, parsing and outputting?

ENDHTML example
$myvar= 'foo'; print <<ENDHTML; <html> <body> Todays variable is: $myvar </body> </html> ENDHTML

TEMPLATE SPAGHETTI example
open $templatefile; $newfilecontent= &parse($templatefile, \@replacements); open $newfile; print ($newfile, $newfilecontent);

I've come to the conclusion ENDHTML printing is more CODE-WISE and maybe more practical to develop, but its surely not open to flexibility. On the other hand, the convenience of template parsing means lots of code for managing errors and exceptions...
Which are your personal ideas on the most PRACTICAL way to proceed?

Thanks in advance