Welcome to the Monastery | |
PerlMonks |
Re: Table in Perl CGIby GrandFather (Saint) |
on Aug 02, 2015 at 09:54 UTC ( [id://1137164]=note: print w/replies, xml ) | Need Help?? |
As a general thing mixing HTML and code is a Bad Thing™ because it makes it harder to maintain both the code and the HTML. Better is to use modules such as HTML::Template which lets you write most of the page as an ordinary HTML file and add a little magic to allow parts of the HTML to be provided by the script. Consider:
Prints:
Usually an external file would be used instead of the here doc and string in the sample. Update: output fixed - thanks CountZero
Premature optimization is the root of all job security
In Section
Seekers of Perl Wisdom
|
|