[EMAIL PROTECTED] wrote:
> 
> Hi -

Hello,

> I am grinding through =Programming Perl= and came to the section on Here
> Documents in Chapter 2 (forgive me, I can't think of the term "Here documents"
> without thinking that there must be a dog somewhere named Documents).
> 
> Anyhoo, I tried typing some of the examples at the keyboard. They stick in my
> memory better that way. I'm wondering why
> 
> print << x 10;
> The camels are coming!
> 
> only seems to work if there is a blank line (e.g. a carriage return) after the
> string to be printed. If I don't put that blank line in, I get the error
> 
> Can't find string terminator anywhere before EOF at ./perlcamel.pl line 3
> 
> (perlcamel.pl is what I called this).
> 
> I'm sure this is a basic question, but the book does not seem anyway to mention
> a need for a blank terminating line.

That is because your example uses "" for the terminator.

print << x 10;
The camels are coming!

Is exactly the same as:

print <<"" x 10;
The camels are coming!

So a blank line is required to terminate the string.


John
-- 
use Perl;
program
fulfillment

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

Reply via email to