From: "Wayne Mr." Date: 2012-07-22T07:50:57+09:00 Subject: File.open error when variable is used I have a situation in a ruby program where a filename is being passed as an argument to a program and is being used in the program as follows: File.open($fileName, "r") The file refuses to open for read and the program abends despite the fileName having the exact correct value! I have tried to strip, chomp, and clean the fileName in every possible conceivable way and yet the only thing that works is this stupid fix which only servers to reassign it! Does anyone understand this? if $fileName == "myfile" then $fileName = "myfile" end -- Posted via http://www.ruby-forum.com/.