From: Peter Vandenabeele Date: 2012-01-23T03:10:23+09:00 Subject: Re: codepart - please explain! --20cf303349735782a604b721d129 Content-Type: text/plain; charset=UTF-8 On Sun, Jan 22, 2012 at 6:54 PM, Blub Bla wrote: > Hey everyone, > > I've found a code part that I don't understand: > > > > def runCode > return < (..) > STARTCODE > end > > > Unfortunately the google search doesn't work because the << will be > ignored. > Could you explain what it's doing? > > Oh, and I can't try out what it's doing because I'll get the error that > STARTCODE can't be found until EOF... > The technique is called a "here doc". First match in Google http://blog.jayfields.com/2006/12/ruby-multiline-strings-here-doc-or.html The specific issue in your code example is that you need to use either: def runCode return < > Thx > > -- > Posted via http://www.ruby-forum.com/. > > -- Peter Vandenabeele http://twitter.com/peter_v http://rails.vandenabeele.com gsm: +32-478-27.40.69 e-mail: peter@vandenabeele.com --20cf303349735782a604b721d129--