From: Nat Pryce Date: 2001-09-22T09:29:39+09:00 Subject: [ruby-talk:21511] Re: Replacement for __FILE__ == $0 From: "Kevin Smith" > --- Nathaniel Talbott wrote: > > OK, this will probably end up being an RCR, but first I > > want to get some > > feedback. Does this construct bother anybody else?: > > > > if __FILE__ == $0 > > ... Do stuff ... > > end > > The __FILE__ part doesn't bother me, but the $0 does. How > about just creating an alias for $0? It's the main file, > right? so __MAINFILE__ or $MAIN_FILE or something like that > seems reasonable. I think *ALL* the cryptic perl leftovers > should have friendly aliases, and most already do. Doesn't "require 'English'" do what you want? require 'English' if __FILE__ == $PROGRAM_NAME ... Do stuff.... end