From: 7stud -- Date: 2011-08-13T14:51:42+09:00 Subject: Re: Stuck at an Issue with OptParse and File IO require 'optparse' require 'ostruct' arr = [1, 2, 3] arr.logfile = "my_file.txt" --output:-- undefined method `logfile=' for [1, 2, 3]:Array (NoMethodError) options = OpenStruct.new options.logfile = "my_file.txt" puts options.logfile --output:-- my_file.txt The lesson: identical variable names that appear in different scopes are not the same variable. -- Posted via http://www.ruby-forum.com/.