Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Answer: What is the best tool to embed perl in HTML?

by Anonymous Monk
on Mar 14, 2004 at 10:58 UTC ( #336479=categorized answer: print w/replies, xml ) Need Help??

Q&A > CGI programming > What is the best tool to embed perl in HTML? - Answer contributed by Anonymous Monk

I could not find an easy one line solution for embedding the output easily into html.

if your server supports php, you could do this:

Create a new text document-->Open it-->put this one line of code into it:

<? virtual("/cgi-bin/foldername/scriptname.cgi"); ?>

--> Save the file as "scrtest.php" (We sometimes need to use the "Double Quotes" to make sure your editor does not put a .txt or .doc on the end of the file extension)

Upload to webserver, then go to Internet Explorer Address bar -->

If your thinkin What about the rest of my HTML, you could use this:

Your Html before the script output gets called

<? virtual("/cgi-bin/folder/scriptname.cgi"); ?>

Your HTML After the script output has been called</body></html>

(again it will have to be saved as a .php page. index.php if you want it as the default document in a folder (rename the old index.html to indexold.html; it may check for this file first when a page is not specified in a web address.)

  • Comment on Answer: What is the best tool to embed perl in HTML?
Replies are listed 'Best First'.
Re: Answer: What is the best tool to embed perl in HTML?
by chanio (Priest) on Mar 15, 2004 at 03:42 UTC
    Thank you for the tip.

    It is more probable that you have SSI. So, index.shtml would do.

    If you put an onLoad= attribute that calls a JavaScript you could also call your perl script and embed it with a document.write command.

    You could redirect an index.html to your perl script. And in it use a template to embed your output in an html page that would appear as a result of your script.

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2020-09-22 08:04 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (128 votes). Check out past polls.