Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old April 2nd, 2006, 08:25 AM
Al Franz
Guest
 
Posts: n/a
Default Include Header and Footer to Print From Perl?

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!


  #2  
Old April 3rd, 2006, 06:35 AM
Joe Smith
Guest
 
Posts: n/a
Default Re: Include Header and Footer to Print From Perl?

Al Franz wrote:
[color=blue]
> 2. Can you include the html code in the perl script without having to
> include a "\" prior to every quote?[/color]

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

http://perldoc.perl.org/perlop.html
  #3  
Old April 3rd, 2006, 01:47 PM
Al Franz
Guest
 
Posts: n/a
Default Re: Include Header and Footer to Print From Perl?

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" <joe@inwap.com> wrote in message
news:AaSdnbdkeruuL63ZRVn-uQ@comcast.com...[color=blue]
> Al Franz wrote:
>[color=green]
>> 2. Can you include the html code in the perl script without having to
>> include a "\" prior to every quote?[/color]
>
> Yes. Look for "Quote-like Operators" in `perldoc perlop`. qq{} and
> here-doc in particular.
>
> http://perldoc.perl.org/perlop.html[/color]


  #4  
Old April 3rd, 2006, 03:05 PM
Jürgen Exner
Guest
 
Posts: n/a
Default Re: Include Header and Footer to Print From Perl?

Al Franz wrote:[color=blue]
> 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?[/color]

See
perldoc -f open

jue


  #5  
Old April 4th, 2006, 03:55 AM
Joe Smith
Guest
 
Posts: n/a
Default Re: Include Header and Footer to Print From Perl?

Al Franz wrote:[color=blue]
> Having Perl print the contents of another file containing the header and
> footer information is not a possibility though?[/color]

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.
[color=blue][color=green][color=darkred]
>>> 2. Can you include the html code in the perl script without having to
>>> include a "\" prior to every quote?[/color]
>> Yes. Look for "Quote-like Operators" in `perldoc perlop`. qq{} and
>> here-doc in particular.
>>
>> http://perldoc.perl.org/perlop.html[/color][/color]

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

-Joe
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles