Programming Ruby 3.2 (5th Edition): B2.0 page 436, why \ in heredoc?

@noelrappin

Already in the previous edition !

page 436, paragraph after reference/quoting.rb

In the previous example the backslash after Double quoted caused the logical line to be continued
with the contents of the next line.

The backslash is not necessary, especially not in a here document.

print <<HERE
Double quoted
here document.
It is #{Time.now}
HERE
% ruby -w reference/quoting2.rb
Double quoted
here document.
It is 2023-02-13 12:07:56 +0100

Yeah, I think you are correct. Fixed