From: Ib Lis Date: 2008-07-07T05:08:54+09:00 Subject: Accessing variables when loading a file to irb Hi I'm new to Ruby. Coming from Perl I really do enjoy the syntax and... irb. When I load a file, classes are loaded but not the variables set in the file. My file ends like that : fields = Set.new bibfile.each do | entry | entry.properties.keys.each do | field | fields << field end end p fields After load, irb prints the value of fields but the variable is not in scope : >> load 'bibtest.2.rb' # => true >> fields NameError: undefined local variable or method `fields' for main:Object Thanks in advance for any hints -- Posted via http://www.ruby-forum.com/.