include Perl in HTML?

  • Hiei
  • Beginner
  • Beginner
  • No Avatar
  • Joined: May 24, 2004
  • Posts: 51
  • Status: Offline

Post June 24th, 2004, 4:51 pm

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 24th, 2004, 4:51 pm

  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Joined: May 28, 2003
  • Posts: 23404
  • Loc: Woodbridge VA
  • Status: Offline

Post June 24th, 2004, 5:04 pm

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.
"There's no place like 127.0.0.1 except for ::1."
Alexandria Networks. Leader in IT consulting for associations/non-profits, and small to medium sized businesses around the northern Virginia and Washington D.C. metro area.
  • this213
  • Guru
  • Guru
  • User avatar
  • Joined: Mar 01, 2004
  • Posts: 1242
  • Loc: ./
  • Status: Offline

Post June 24th, 2004, 9:58 pm

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 163 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.