From: Gary Wright Date: 2008-01-12T02:40:55+09:00 Subject: Re: Here Document syntax is stringent - trailing blank On Jan 11, 2008, at 8:05 AM, Todd Burch wrote: > Hi there. Why does the Here Document > require there to be no space after > the closing symbol? If I type "EOD " and press > enter, I get a syntax error. (See below.) If I type "EOD" with > an immediate carraige return, it works fine. > > Why so stringent? I would guess because it is simpler to implement and simpler to understand. If you made trailing white space allowed on the closing delimiter then you must define 'white space' and you have to explicitly ignore it when scanning for the end of the text. If you changed the rule to simply look for a line prefixed by the delimiter (so that white space wasn't an issue) then you would end up with strange things like: text <