How can I use Perl to open a file and use its contents populate a table in HTML? For example, when the submit button in a HTML form is clicked, it'll activate the 'populate.cgi' script to open a file and use its contents to populate a table (eg. names for its rows and occupation for its columnx) of a newly created HTML page.
Well, there's no magic way to do this. You basically have the perl script open the "data file" and read it's contents. As you read each line, you print out the resulting line of HTML code. When you are done, you have a full HTML page, either printed out to the screen (sent back to the user) or printed to a flat file (for viewing on your site).
That's the basic overview of one way to do it, anyway. Hope it helps.
Bookmarks