Jack Christensen
7/29/2006 1:37:00 AM
Is there some reason heredocs fail if there is white space after the
closing string? Until I realized what was happening this caused me a
good bit of trouble. Invisible characters shouldn't cause stuff to fail.
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.
I looked through the relevant PickAxe sections and didn't find anything.
Jack