From: Mike Steiner Date: 2007-05-02T11:27:22+09:00 Subject: strangeness with string concatenation and function return values ------=_Part_677_30888751.1178072841838 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I get an error when running code snippet A, but if I change it to B, there's no error. I'm not familiar enough with Ruby to know why this is. Could someone explain this? ----- A ----- def ReturnString ( ) return "abc" end File.open ( "junk.txt" , "w" ) do | f | f.write ( ReturnString ( ) + "\n" ) end ----- B ----- def ReturnString ( ) return "abc" end File.open ( "junk.txt" , "w" ) do | f | s = ReturnString ( ) f.write ( s + "\n" ) end If it makes any difference, I'm running Ruby under Windows. Mike Steiner ------=_Part_677_30888751.1178072841838--