From: "SHULTZ,BARRY (HP-Israel,ex1)" Date: 2001-08-23T22:48:25+09:00 Subject: [ruby-talk:20180] RE: Recursively passing blocks... Hi, > > I was attempting to implement a recursive directory walker > (before someone > pointed me at Find.find), but this question remains... > > class Dir > def Dir.walk(path, &block) > # ...stuff > if something > walk(child, block) > else > block.call(child) > end > end > end > > Dir.walk(".") { |f| puts f } > > If I pass two arguments to walk, I get an error, because it's > only expecting > one. I think it's a typo on your part. It should work if you call walk(child,&block), not walk(child,block) as you wrote. Hope that helps, Barry