By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,530 Members | 891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,530 IT Pros & Developers. It's quick & easy.

Include Header and Footer to Print From Perl?

P: n/a
Editing a script that has a "sub printheader" and "sub printfooter" routine
before and after it creates a web page with a message. I would like to
customize this script so that I can have my own header and footer. What is
the best way to do this?

1. Can you create a "sub" that references a separate file to print as a
header and footer?
2. Can you include the html code in the perl script without having to
include a "\" prior to every quote?

Thanks!
Apr 2 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Al Franz wrote:
2. Can you include the html code in the perl script without having to
include a "\" prior to every quote?


Yes. Look for "Quote-like Operators" in `perldoc perlop`. qq{} and
here-doc in particular.

http://perldoc.perl.org/perlop.html
Apr 3 '06 #2

P: n/a
Having Perl print the contents of another file containing the header and
footer information is not a possibility though? I need to put the HTML code
within the Perl script?

"Joe Smith" <jo*@inwap.com> wrote in message
news:Aa********************@comcast.com...
Al Franz wrote:
2. Can you include the html code in the perl script without having to
include a "\" prior to every quote?


Yes. Look for "Quote-like Operators" in `perldoc perlop`. qq{} and
here-doc in particular.

http://perldoc.perl.org/perlop.html

Apr 3 '06 #3

P: n/a
Al Franz wrote:
Having Perl print the contents of another file containing the header
and footer information is not a possibility though? I need to put
the HTML code within the Perl script?


See
perldoc -f open

jue
Apr 3 '06 #4

P: n/a
Al Franz wrote:
Having Perl print the contents of another file containing the header and
footer information is not a possibility though?


I never said that. I did not bother answering that part since the answer
is so obvious. Perl was created to create reports - reading in multiple
files, analyzing them, and printing the results.
2. Can you include the html code in the perl script without having to
include a "\" prior to every quote?

Yes. Look for "Quote-like Operators" in `perldoc perlop`. qq{} and
here-doc in particular.

http://perldoc.perl.org/perlop.html


Question: Have you ever used the "here-doc" feature? It is very
useful, and I recommend you try it.

-Joe
Apr 4 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.