in reply to (Daddio) Re: hello
in thread String terminator problems.

Careful, that's not quite accurate!

The single quotes force a non-interpolative context, just like single quotes around a string. By default, here documents act like double quoted strings. His construct is valid.

Similarly, you can only get away without the semicolon in a place where a statement doesn't need a closing semicolon -- at the end of a block or the end of a file. In this case, it would work if the original poster posted his complete program.

My guess is that adding a newline or something after the terminator would fix it. Perhaps his editor doesn't add an EOF? He could also use exit or __END__.

Replies are listed 'Best First'.
Re: Re: (Daddio) Re: hello
by Daddio (Chaplain) on Jun 21, 2001 at 05:29 UTC

    Thanks, chromatic, for explaining those points a bit. I looked through code I have (both mine and others) and was completely unsure about (1) when to single/double quote and (2) use the semi-colon. I'm still learning, too, and thought I would point out that I have seen it done both ways (missing, of course, the reason why). Thanks again for clarifying.

    D a d d i o