Print <<XXX parses some text in scope ending with XXX -- Why?

From: Richard Lionheart [mailto:NoOne@Nowhere.com]

text from <<XXX to the next XXX. But that doesn’t happen with
some quoted
strings in that block, as follows. Why?

Because you are using an inline variable substitute (#{}). You can escape
it, as below:

print <<TEST
xxxx
yyyy
“abc”

class A
def initialize(*args, &block)
puts ‘—’
puts “args <#{ args.inspect }>”

puts "args <\#{ args.inspect }>" 
 block.call if block

end
end
TEST

David
http://homepages.ihug.com.au/~naseby/

···

-----Original Message-----