include Perl in HTML?

  • Hiei
  • Beginner
  • Beginner
  • Hiei
  • Posts: 51

Post 3+ Months Ago

first off sorrry if this is in the wrong forum i couldn't decide where to place it...anyway my question is this. can you include prewritten PERL code in an HTML code? do i just have to add an extension to something. thanks for your help
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23456
  • Loc: Woodbridge VA

Post 3+ Months Ago

I'm not an expert, but have moderated other forums that do this, although I've never really written the code - only modified it. I believe your best route is use shtml and use includes for the Perl.

But I've seen it done, so I know it can be done...just not sure how to tell you how to go about it. There's a few here comfortable with perl so I suspect you'll get a better answer, so stick around.
  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

The configuration of your server dictates how you can include scripts in your html files. Generally speaking, if you call a script that outputs html from a .shtml document, the script wil execute properly.

Basically, this code will add your script to the page:
Code: [ Select ]
<!--#exec cgi="/cgi-bin/myscript.cgi"-->

The script location must be a valid URI avalable to the internet and should be set as the server's URI path to the script. To iterate:
http://www.mysite.com/cgi-bin/myscript.cgi <-- Won't work, this is a URL, not a server URI - this is to stop people from running your scripts on their sites
/cgi-bin/myscript.cgi <-- Will work, this is how the server finds stuff on itself

if the scripts are in the same directory as the calling page (and your server is set up to allow scripts to run no matter what directory they're in) you can just call the name of the script:
<!--#exec cgi="myscript.cgi"-->
Also, for some reason, if the script is one directory higher than the calling page, you can do:
<!--#exec cgi="../myscript.cgi"-->
but, you could get errors doing
<!--#exec cgi="../../myscript.cgi"-->

hth
This

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 87 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.