Bradley,

I'm not sure your second example would work. I don't think single quotes
block interpolation

-----Original Message-----
From: Bradley M. Handy [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 13, 2001 12:56 PM
To: Tony Paterra; [EMAIL PROTECTED]
Subject: RE: Copy and past HTML into a perl script


Your quotes may be mismatched.  Meaning that you are enclosing the entire
HTML source with double quotes and you have unescaped double quotes in your
HTML source.  That would confuse perl.

        For example:

                print "<img src="image.gif">";  # in this line image.gif is
a bareword.

        You should do this:

                print '<img src="image.gif">';  # this does not interpolate
variables
though.

        or

                print "<img src='image.igf'>";  # this does interpolate
variables.

        or

print <<"HTML";                         # this does interpolate variables if
you use double
quotes.
<img src="image.gif">
HTML

But if you're looking for a longer term solution.  Here are my suggestions:

        1. Use the Template Toolkit set of modules available at:
                http://search.cpan.org/search?module=Template
        2. Use the HTML::Template module available at:
                http://search.cpan.org/search?module=HTML::Template
        3. Put your HTML in a separate file, open it and the print the lines
as you
read them.

If you do one of the above then you can modify your HTML source and not
worry about screwing up your code.  Plus it makes your code more readable.

Brad Handy

--www.jack-of-all-trades.net
[EMAIL PROTECTED]


> -----Original Message-----
> From: Tony Paterra [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 13, 2001 1:45 PM
> To: [EMAIL PROTECTED]
> Subject: Copy and past HTML into a perl script
>
>
> I have a cgi script that I need to past approx 40 lines of HTML
> into.  I was
> hoping I could just get away with having a
>
> print "<paste HTML here>";
>
> and get away with that but sadly no, I get incomplete set of
> headers errors.
>
> Any suggestions?
>
> Thanks,
> Tony
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to