How to return an HTML page from a Perl script ?

R

Rodney

1. I want to have a ahref link, on an HTML page, point to a PERL script.
2. The Perl script will open an existing HTML document and change some of
its content.
3. After altering the HTML document, I want it to be returned to the Web
Client.


I don't want to re-write the entire HTML document with in the PL script
(because then the HTML document can not be easily edited using an HTML
editor). I only want to change certain content then return the document to
the client.

How do I do that?

The PERL script changes the document.... but then it doesn't "return" it ??



Thanks,
 
A

Andras Malatinszky

Rodney said:
1. I want to have a ahref link, on an HTML page, point to a PERL script.
2. The Perl script will open an existing HTML document and change some of
its content.
3. After altering the HTML document, I want it to be returned to the Web
Client.
Read up on the redirect method in the CGI.pm documentation
(http://stein.cshl.org/WWW/software/CGI/#header is a good place to start).
 
R

Rodney

I found a simple way to do it.

No CGI libraries or anything is required.

NOTE: It's important to include the \n\n and the return value of 1


===============================

$theUrl = http://www.yourplace.com


sub Redirect_page {
print "Location: ", $theUrl,"\n\n";

1;
}





===============================
 
R

Rodney

NOTE:
In my previous post, I defined the URL link and the Newsgroup caused it to
be a URL-Link.... So, you're not seeing the double quots around it. You
must include double quotes around the URL address... ie; "your URL here"
 
C

C. Olive

Rodney said:
1. I want to have a ahref link, on an HTML page, point to a PERL script.
2. The Perl script will open an existing HTML document and change some of
its content.
3. After altering the HTML document, I want it to be returned to the Web
Client.


I don't want to re-write the entire HTML document with in the PL script
(because then the HTML document can not be easily edited using an HTML
editor). I only want to change certain content then return the document to
the client.

How do I do that?

The PERL script changes the document.... but then it doesn't "return" it ??

I see you've already received the answer I would have offered:
HTML::Template. Highly recommended. If you need a sample interaction
to help you put the pieces together, just say so and I'll drop one
here for you to look at. Examples always help... :cool: HTML::Template
rocks...

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top