From: "Wolfgang Nádasi-Donner" Date: 2007-01-29T09:20:07+09:00 Subject: Re: Ruby << is ambiguos Yukihiro Matsumoto schrieb: > |irb(main):007:0> angy < |irb(main):008:0" xxxxx > |irb(main):009:0" EOT > |NameError: uninitialized constant EOT > | from (irb):7 > > Ruby knows angy is a local variable, so that the interpreter consider > it is more likely a shift operator than a here-doc. If you want to > disambiguate, use parentheses. I made an error there. "angy" followed by a String doesn't make any sense. It works very well if written in in a senseful way. irb(main):001:0> angy = "abc" => "abc" irb(main):002:0> angy <<< "abcddd\n" But... - there is one thing I really don't understand in the first example. Ruby recognizes "EOT" as an uninitialized constant, because "<<" ist interpreted as shift operator. But why is an open here-doc string recognized in line 008:0" in the example? Wolfgang N�dasi-Donner