From: Jason Foreman Date: 2005-08-12T05:38:34+09:00 Subject: Re: How do I use heredocs On 8/11/05, hsun wrote: > Hi, > > I have a simple test program. > > ==================== > class QuickTest > > def testMe > str = < Some Application data > EOS > puts str > end > > end > > if $0 == __FILE__ then > > $test = QuickTest.new > $test.testMe > end > =========================== > > I got this error and could not figure out what's wrong? > > ============================================== > QuickTest.rb:21: can't find string "EOS" anywhere before EOF > QuickTest.rb:6: syntax error > =============================================== > > Can someone help? > > I am running Ruby 1.8 on Windows XP > > > Thanks > > Works fine for me. Are you 100% sure that "EOS" begins in column 0? This must be true or it will not be found. Otherwise, change to <<-EOS, where the - will let you indent the terminator. Jason