From: schuerig@... (Michael Schuerig) Date: 2001-02-11T06:10:02+09:00 Subject: [ruby-talk:10684] Passing on a block to a called method Currently, when I want to pass on the block given to one method to called method, I do it like this: openAsText(file) do |f| f.each do |l| ... end end def openAsText(file) block = Proc.new filter = buildTextFilter(file) if filter.empty? File.open(file) { |f| block.call(f) } else IO.popen("cat #{file} #{filter}") { |f| block.call(f) } end end What I'm wondering about is whether this conversion to a Proc is really necessary or if there's a more direct way to pass on the block. Michael -- Michael Schuerig mailto:schuerig@acm.org http://www.schuerig.de/michael/