From: Bertram Scharpf Date: 2005-05-25T04:58:09+09:00 Subject: Re: if __FILE_ == $0 executed twice Hi, Am Dienstag, 24. Mai 2005, 18:19:37 +0900 schrieb Han Holl: > As recommended in the pickaxe I often have a section at the end of a > .rb file with > if __FILE__ == $0 > .... > end > > However, if one of the included files includes this file itself (not > unlikely at all), the code gets executed twice. Not here. What is your output of this: -------------------- def gen prg, oth name = "#{prg}.rb" File.open name, "w" do |f| f.puts <