From: Richard Date: 2006-12-05T02:45:05+09:00 Subject: How to use a String obj both in Proc.new and for puts Hi All, In the appended code I duplicate the text so I can both display it and define a new Proc. Is there away I can use, say, text = '[*1..n].join(", ")' in the body of the Proc spec. and thus simply puts text? Thanks in advance, Richard def example(n) return Proc.new { [*1..n].join(", ")} end puts %q![*1..n].join(", ") ! + " #=>" puts example(3).call # => 1, 2, 3