From: Phrogz Date: 2006-11-05T13:25:09+09:00 Subject: Re: how to know if i am in a module or in the main script ? Stephane Wirtel wrote: > if $0 == __FILE__ > puts "This is the main function" > else > puts "This is a module" > end > > Is it right ? Yes, that is a very common idiom used by many Ruby programmers to determine if the code is being included or 'run' by itself. Good job figuring it out. :)