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


in reply to Question about HTML and Perl

You say your Perl script works and you want to embedd it's output in an HTML document. What might be a simpler and easier to set up approach would be to have the script write the HTML document. Then you access the script via CGI, as explained in the links posted above by GrandFather.

So the script builds an HTML document and sends it's output to the browser, and the browser renders it as it would any other document.

There are ways you can embed Perl code within your document, and have the document be parsed as it's sent to the browser so that the code gets executed and replaced by it's own output. But I think it might be easier to start with CGI - when I was new to Perl I remember setting up CGI was fast and easy, but I don't know how difficult other approaches might be to a new Perl programmer, as I never tried when I was one.

Actually, there was a book I had for a class that I think had a good explanation of CGI and setting up a simple dynamic web page with Perl - but all I can remember is that it had a yellow and black cover. From scanning the pictures at Google shopping, I think it might have been Beginning Perl.