On Tue, Sep 17, 2002 at 10:33:35PM +0900, William Djaja Tjokroaminata wrote:
> Hi,
> 
> May we know the actual purpose of this?  If the indenting is really
> consistent, we can just try to "gsub" it:
> 
> foo = %Q!\
>     this is a string #{#some comment}\
>     that is continued on a second line
> !
> foo.gsub! (/    /, '')

Well, I typed it misleadingly the first time.  In code, you'd see
something like this:

  def bar
    foo = %Q!\
      this is a string #{#some comment}\
      that is continued on a second line
    !
    foo.gsub! (/    /, '')
    return foo
  end

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