From: Lothar Scholz Date: 2004-03-23T23:32:04+09:00 Subject: How to pass a given block to a subroutine Hello , I have a method 'foo' that takes a block, but the yield should be done in a subroutine. ====================================================== class Example def foo (*args) subroutine *args end def subroutine *arg yield *arg # want to call the block given to foo end end a = Example.new a.foo(10,20) { |a,b| print "#{a + b}\n" } ======================================================= If you ask why i want to do this: i have to replace an existing subroutine with my own version, that does something before yield is called. So i renamed the method and must now find a way to call it from my version. -- Best regards, Lothar mailto:mailinglists@scriptolutions.com