From: Karl von Laudermann Date: 2008-07-12T02:20:59+09:00 Subject: Re: block variable not working how I expect it to work On Jul 11, 1:11 pm, Martin DeMello wrote: > Therefore your code should be: > >  def myblock >     testvar = ['cool', 'array'] >     testvar = yield testvar >     print testvar >  end > >   myblock do |stuff| >     return "dumb string" >   end I was going to post a response similar to yours but you beat me to it. However, I tried your version, and the return statement is causing an error. You instead just want to do: myblock do |stuff| "dumb string" end