From: Jean-pierre Riviere Date: 2006-11-14T20:42:41+09:00 Subject: Re: capitalize bug? spooq wrote: > On 11/14/06, Jean-pierre Riviere wrote: >> nom = wnom.gsub(/_+(.)/) { |deb| deb[1, 1].upcase } > > This is clearer... the dollar vars are assigned properly inside the > block. > > foo.gsub(/_+(.)/) { $1.upcase } thank you for all the explanations guys. now, I don't know which one is clearer... which one would you recommend? Surely yours with $1 has a greater scope, especially if $1 recovered something more complex in my regexp... Just have to get used to it, I suppose. -- Jean-Pierre -- Posted via http://www.ruby-forum.com/.