From: fprimus Date: 2006-07-31T06:51:45+09:00 Subject: Re: Heredocs and white space Jack Christensen wrote: > Example: > s = <<-HEREDOC > bla bla bla > HEREDOC > This fails with: > > heredoc.rb:3: can't find string "HEREDOC" anywhere before EOF > heredoc.rb:1: parse error, unexpected $, expecting tSTRING_CONTENT or > tSTRING_DB > EG or tSTRING_DVAR or tSTRING_END > > Delete the spaces at the end of the 3rd line and it works. It works then because "HEREDOC" is equal to "HEREDOC", when the space at the end is present it's "HEREDOC ". I just tried it at the command line using bash and when there was a space at the end it did not blow up, it merely included the "HEREDOC " as the last line. Removing the space caused it to work correctly. I did not try it under perl or php. -- Music: http://www.myspace.com/acidredux Links: http://del.icio.us/furlan Home: http://thispaceavailable.uxb.net/index.html We are here to laugh at the odds and live our lives so well that Death will tremble to take us. -- Charles Bukowski