From: Joel VanderWerf Date: 2002-10-30T14:46:16+09:00 Subject: Re: DATA and require coma_killen@fastmail.fm wrote: > Hi, > > I have a file that uses __END__ and DATA to read in a large > string. It works fine when I run it directly. > > But when I require that file in another one it says > > "uninitialized constant DATA" > > Why? I guess DATA is associated with the $0 file, i.e., the file that was first passed to the ruby interpreter. For example: $ cat a.rb require 'b' __END__ In DATA of a.rb $ cat b.rb p DATA.gets(nil) __END__ In DATA of b.rb $ ruby a.rb "In DATA of a.rb\n" $ ruby b.rb "In DATA of b.rb\n"