Re: Perl and SSI
by "John Murray" <jmnc(at)lis.net.au>
|
Date: |
Sat, 16 Mar 2002 19:20:55 +1100 |
To: |
"jim barchuk" <jb(at)jbarchuk.com> |
Cc: |
<hwg-techniques(at)hwg.org> |
References: |
jbarchuk |
|
todo: View
Thread,
Original
|
|
Have you come accross:
1. "Here" statements?
#########
print (<< "TIL_YOU_SEE_THIS_ON_ITS_OWN_LINE_WITH_NOTHING_ELSE_ON_THE_LINE")
html stuff
more
more
more
TIL_YOU_SEE_THIS_ON_ITS_OWN_LINE_WITH_NOTHING_ELSE_ON_THE_LINE
##########
2. Print $this_bloody_long_bunch_of_characters;
That is, you can load the variable with the html to print to the browser
away from the print section of your code.
3. To read the contents of a whole file into a variable that you can print
do this:
undef $/;
$this_bloody_long_bunch_of_characters = <MY_FILE>
this kills the characters in the end of record special variable $/ so when
you read from a file with <MY_FILE> it wont stop at \n on that read.
Hope that adds something to your cause ...
> > I have a cgi script for an guestbook. On a couple of the pages that it
> > generates, I am finding it most difficult to get it to write HTML code
that
> > I have added. I'm not sure how to go about this. Can an SSI be placed
into
> > an additional "print" statement in the cgi script; e.g.
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA