From: Jason Roelofs Date: 2008-06-12T01:28:36+09:00 Subject: Re: how to avoid multiple inclusion of a file As long as the require lines are exactly the same, there's nothing to worry about. file1.rb: require 'lib' file2.rb: require 'lib' This will work fine. You will run into problems if you put relative paths though: file1.rb: require 'lib' lower/file3.rb: require '../lib' This will end up require-ing lib.rb twice, and possibly cause problems. Either use full paths, or add directories to the $LOAD_PATH to protect against this. Jason On Wed, Jun 11, 2008 at 12:24 PM, suresh wrote: > Hi > > My program is split up into multiple files, each containing a set of > related class definitions. In the main file, all these files are > included by using require. But how can i avoid multiple inclusion of a > file by mistake. > > Is there anything similar to C languages #ifndef ....... > > thanks > suresh > >