From: "Jens Finnäs" Date: 2011-02-04T21:04:15+09:00 Subject: Arrays and defs Hi, I've just started learning Ruby for screen scraping purposes and I've now run in to a problem I can't get my head around. Is it not possible to call an array outside a defintion? Like this: list = Array.new list = ["a", "b", "c"] def do_stuff() list.each_index do |i| puts list[i] end end do_stuff() If I define list inside do_stuff() the script works. My plan was to build an array through several functions. -- Posted via http://www.ruby-forum.com/.