James Gray
2/21/2006 3:17:00 PM
On Feb 21, 2006, at 8:58 AM, raving_ruby_rider wrote:
> I noticed that a lot of scripts apply the following coding pattern:
>
> if __FILE__ == $0
> ....
> end
>
> I know what is does but what kind of problems does it solve?
It allows the file to be both a library (when required the if
statement will not run) and executable.
Hope that helps.
James Edward Gray II