From: Alex Young Date: 2007-07-03T03:11:17+09:00 Subject: Re: getting rid of $0 Tim Pease wrote: > On 7/2/07, Michel Demazure wrote: >> The common idiom >> if __FILE__ == $0 then ... >> gives bugs when $0 is not what one would expect, for instance under a >> debugger, or in rubyscript2exe, etc. >> >> There should be a primitive test >> if then... >> > > require 'English' > > if __FILE__ == $PROGRAM_NAME > ... > end > Does that solve the problem? Isn't that vulnerable to the same issues as just using $0? -- Alex