On Friday 27 December 2002 01:53 am, Bulat Ziganshin wrote:
| Hello Matthew,
|
| Friday, December 27, 2002, 9:44:53 AM, you wrote:
|
| MH> Hi:
|
| MH> I want to create a long string containing line breaks so I wrote
| MH>        a = <<END
| MH>             a few lines ....
| MH>        END
|
| MH> but Ruby can never find the closing END anywhere before EOF.   Is there
| MH> something I'm missing?
|
| spaces before second EOF?

Matthew,

From the Pickaxe (Programming Ruby by David Thomas and Andy Hunt), pgs 
204-205:
"You can put a minus sign immediately after the << characters, in which case 
the terminator can be indented from the left margin."

But I wouldn't use the word 'END' as a here document terminator-- END is a 
standard block to be run after the program has finished executing (Pickaxe pg 
202).  Apparently Ruby will let you do it (on 1.7.3, at least), but using it 
is a Bad Thing, IMHO.

Hope this helps,

~ Bruce

-- 
Bruce R. Williams :: [iusris/#ruby-lang] :: http://www.codedbliss.com

  'It does not require a majority to prevail, but rather an irate,
  tireless minority keen to set brush fires in people's minds.'
  -- Samuel Adams