From: William Djaja Tjokroaminata Date: 2002-09-17T23:33:44+09:00 Subject: Re: comments and continuing strings on the next line Hi, I guess if it were for me whether I am going with the first solution foo = "this is a string " + # this is a comment "that is continued on a second line" or the second solution foo = %Q!\ this is a string #{#some comment}\ that is continued on a second line ! really depends on whether I write a lot of comments (in which case first solution seems cleaner) or not (in which case we don't have to type so many "'s in the second solution). But then again, in the first solution we can replace " with ', something that we cannot not do in the second solution with %q, and this is not counting the overhead of gsub. It seems the <<< operator is the best solution if it existed. Regards, Bill ========================================================================== Paul Brannan wrote: > I suppose the gsub trick works, though if I'm going to go with an > inefficient solution, I think I'll stick with "+", as long as I have > only two lines. > I do recall one of the apocalypses mentioning a perl rfc that proposed a > <<< operator for 'here documents', which would remove whitespace from > the 'here document' (at compile-time) that matched the whitespace in > front of the terminator. Doesn't seem like a bad idea for either perl > or ruby. > Paul