R
Ronald Fischer
I have problems passing a HERE document as the first parameter
to a function expecting more than 1 parameter. Example:
# This is file here1.rb
def q(a,b)
end
q(<<-END
line1
line2
END
,'x')
Executing this program yields the error messages
/here1.rb:9: syntax error, unexpected ',', expecting ')'
,'x')
^
/here1.rb:9: syntax error, unexpected ')', expecting $end
Using a temporary variable to hold the content of the HERE
string works fine though:
temp=3D<<-END
line1
line2
END
q(temp,'x')
Bug in Ruby? Or do I misunderstand something in the workings of the
parser?
Ronald
--=20
Ronald Fischer <[email protected]>
Phone: +49-89-452133-162
=20
to a function expecting more than 1 parameter. Example:
# This is file here1.rb
def q(a,b)
end
q(<<-END
line1
line2
END
,'x')
Executing this program yields the error messages
/here1.rb:9: syntax error, unexpected ',', expecting ')'
,'x')
^
/here1.rb:9: syntax error, unexpected ')', expecting $end
Using a temporary variable to hold the content of the HERE
string works fine though:
temp=3D<<-END
line1
line2
END
q(temp,'x')
Bug in Ruby? Or do I misunderstand something in the workings of the
parser?
Ronald
--=20
Ronald Fischer <[email protected]>
Phone: +49-89-452133-162
=20