CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
writing out web page headers and footers

 



jeff
Deleted

Dec 4, 2000, 6:58 PM

Post #1 of 5 (583 views)
writing out web page headers and footers Can't Post

Hi Guys. I bet you folks are tired of me asking questions. Thanks for being here.

I have a module that nicely writes out a web page header or footer on the fly and consists of pure html statements with an occational variable for page title, sub titles, footer stuff, etc. format is:
<html>
</head>
<title>$pagetitle</title>
blah blah blah.

What I would like to do is find a way to call the same module routines to write headers to a web page that is being written to disk as a regular web page.

Is there an easy way to do this without sticking in print statements or pushing into an array or something that would ruin the ability to just stick in regular html format?

I hope I have explained this well enough.

Thanks for any help

jeff


jeff
Deleted

Dec 5, 2000, 6:36 AM

Post #2 of 5 (583 views)
Re: writing out web page headers and footers [In reply to] Can't Post

Hi Sleuth. I was afraid I hadn't explained myself well enough heheh.

Ok. I have a module that writes the headers and footers for web pages. It consists of pure html statements. To use it you just put "heading (pagetitle);" in a script and it writes a heading. This is great for the admin web page which is created on the fly every time it is called.

However I also need to use the same heading and footing in webpages that are developed and written only once in a while. Currently the way the module is written there there is no way to include a header using:
print FILEHANDLE,">blah.htm";
This is because the module is a void type and returns nothing, it just spews out the header.

This is where my lack of knowledge is getting me.

I could get it to work for both applications if I were to push each and every line on an array and return the array, but that necessitates altering the pure html statements. I am just writing the heading in frontpage and just copying it over straight to the module which is what I was hoping.

Is there a way of returning a group of html statements without adding a bunch of perl commands to each line of html code? Or a way to allow the module to both print on the fly and print to a filehandle?

I hope this explains it better Sleuth. Thanks for all your help.

Jeff


jeff
Deleted

Dec 5, 2000, 7:23 AM

Post #3 of 5 (583 views)
Re: writing out web page headers and footers [In reply to] Can't Post

Hi Sleuth. I accidently found something that would work hehehe. I love raw luck.

@a<<TOP
<html>
<head>
<title>

blah blah

</html>
TOP

Seems to work. I'll go with that unless you know of a better way of doing it.

Thanks.

Jeff


sleuth
Enthusiast / Moderator

Dec 5, 2000, 10:52 AM

Post #4 of 5 (583 views)
Re: writing out web page headers and footers [In reply to] Can't Post

 
Hi Jeff, I'm not following you,

You have accomplished what you want, now you need to do it more efficiently???

Could you shed some light for me?

Sleuth


sleuth
Enthusiast / Moderator

Dec 5, 2000, 5:26 PM

Post #5 of 5 (583 views)
Re: writing out web page headers and footers [In reply to] Can't Post

 
Nope, go with that, hehe,

Sleuth

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives