From: Damphyr Date: 2006-02-22T04:25:26+09:00 Subject: Re: FILE test Peter Hickman wrote: > You will see this sort of thing in other scripting languages. __FILE__ > contains the name of the file source file and $0 is the name of the > currently executing script. So a file called hello.rb > ... > when you run tom.rb the __FILE__ == $0 part of hello does not run as the > file hello.rb but the currently executing script is tom.rb. This allows > you to have a ruby file hold the class for inclusion by other scripts > and also be a utility script in it's own right. > Not to mention the fact that it allows you to easily write unit tests for most of the code in a script. V.- -- http://www.braveworld.net/riva ____________________________________________________________________ http://www.freemail.gr - ������ �������� ������������ ������������. http://www.freemail.gr - free email service for the Greek-speaking.