From: Michael Sullivan Date: 2001-09-23T02:57:23+09:00 Subject: [ruby-talk:21550] Re: Replacement for __FILE__ == $0 On Sun, Sep 23, 2001 at 02:43:52AM +0900, Charles D Hixson wrote: > On Friday 21 September 2001 06:05 pm, you wrote: > > ... > > I am always reluctant to add new keywords or methods to > > core classes. Using require 'English' (which I wasn't aware > > of) is reasonable in this case, although I would argue that > > $0 is nearly useless as-is, and so should be aliased. > > Having a perl background shouldn't be a prerequisite for > > using Ruby. > >... > > Kevin > ... > > The $0 notation isn't strictly Perl. I first encountered it when > being introduced to the first edition of the Macintosh MPW. They > had taken it in from Unix, but I don't think that Perl was around > then. I think that they got it from grep (regular expressions). > And that was just a small twist from C's command argument > addressing, where the command arguments were stored in a 0 based > array, with the name of the command being the first argument (i.e., > arg[0]). > -- > Charles Hixson $0 has been around in Unix almost forever, and was even in PC-DOS from the beginning for .bat files. Mike -- Michael P. Sullivan Distributed Computing Systems, LLC Cell: 516-429-2080 E-Mail: mps@discomsys.com http://www.discomsys.com/ * UNIX Systems and Database Consulting, Architecture and Management * "Failing to plan, is planning to fail... plan for the worst, hope for the best"