For Programmers: Free Programming Magazines  


Home > Archive > PERL CGI Freelance > March 2004 > print problem? (CGI)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author print problem? (CGI)
Ben Wan

2004-03-19, 1:24 pm

The following code doesn't run.. I don't know what's wrong with it, can someone help me?

print << START_HERE;
<p>Thanks a thousand times... ^_^ </p>
START_HERE

thx...


Vorxion

2004-03-19, 1:24 pm

In article <UKSmb.59582$3f.36505@twister01.bloor.is.net.cable.rogers.com>, Ben Wan wrote:
>The following code doesn't run.. I don't know what's wrong with it, can someone help me?
>
>print << START_HERE;
><p>Thanks a thousand times... ^_^ </p>
>START_HERE


print << 'START_HERE';

You need to quote the bareword identifier for the end of the "here" block.
Note that if you want variable substitution, you should use "START_HERE"
instead. (Double-quotes to indicate interpolation.)

--
Vorxion - Member of The Vortexa Elite
Ben Wan

2004-03-19, 1:24 pm

sorry, but can you tell me what is variable substitution? and does it do anything on "START_HERE"?
Thx...

"Vorxion" <vorxion@fairlite.com> ¼¶¼g©ó¶l¥ó·s»D:3f9c0236$1_1@news.iglou.com...
> In article <UKSmb.59582$3f.36505@twister01.bloor.is.net.cable.rogers.com>, Ben Wan wrote:
>
> print << 'START_HERE';
>
> You need to quote the bareword identifier for the end of the "here" block.
> Note that if you want variable substitution, you should use "START_HERE"
> instead. (Double-quotes to indicate interpolation.)
>
> --
> Vorxion - Member of The Vortexa Elite



Vorxion

2004-03-19, 1:25 pm

In article <axUmb.16068$7B1.9748@news04.bloor.is.net.cable.rogers.com>, Ben Wan wrote:
>sorry, but can you tell me what is variable substitution? and does it do anything on "START_HERE"?
>Thx...


First, don't top-post. It's annoying and confusing.

And to answer your question, if you do:

print << 'END_HERE';
Some $nice text.
END_HERE

It will print:
Some $nice text.

If you do:

$nice = 'substituted';
print << "END_HERE";
Some $nice text.
END_HERE

It will print:
Some substituted text.

Get the idea? Look up the difference between interpolated and
non-interpolated quoting mechanisms. Apply it to 'here' blocks.

--
Vorxion - Member of The Vortexa Elite
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com