From: Hans Mackowiak Date: 2013-03-11T19:45:27+09:00 Subject: Re: Confusion with block local variable declaration with block variable declaration within the pipe it does not work because blocks does not allow "default" parameters like that blocks are different from methods. But you can do that: def talk(x,y=1) p "X = #{x}" p "Y = #{y}" end [1,2,3].each &method(:talk) "X = 1" "Y = 1" "X = 2" "Y = 1" "X = 3" "Y = 1" -- Posted via http://www.ruby-forum.com/.