Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Reading in an html page and including it in cgi ?

Posted on 2003-02-24
Medium Priority
Last Modified: 2013-12-25
Hi there, I have a quick question that hopefully is an easy answer.

I am coding a database driven site using cgi / mysql, but for some of the pages I would like to create a simple html page like form.html then with my cgi code just say like

"include form.html here and display it" so in future I can simply open the html page and edit it without having to scroll through all the cgi code. I assume this is possible?

In coldfusion for example, you can just use "cfinclude template=form.html" then it would display it.

It doesnt have to be .html it could be a .txt file.

Thanks for any help in advance

Scott Wright
Question by:scottwwright
  • 3
LVL 17

Expert Comment

ID: 8007908
open (F, "data.txt");
while(<F>) {
  print $_;

You might find HTML::Template to be more useful though.
LVL 17

Accepted Solution

dorward earned 300 total points
ID: 8007916
http://perlmonks.thepen.com/65642.html <<-- HTML::Template tutorial.

Author Comment

ID: 8007940
execellent work, just what the doctor ordered.

Thanks !
LVL 17

Expert Comment

ID: 8007987
Glad to have helped.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question