From: Bob X Date: 2002-10-22T10:55:42+09:00 Subject: What I did (was Re: functional Ruby equiv to this perl snippet) Here is what I did...with your help and looking through different ways to handle stuff. # get the servers out of the file def load_server_list servers = [] filename = 'serverlist.txt' if FileTest.exist?(filename) File.open(filename).each do |line| next unless line =~ /^\S+$/ next if line =~ /^#.*$/ servers << line.chomp.sub(/\s+#.*$/, '') end servers else puts "The serverlist.txt file does not exist." exit end end This tests for the existence of the file first and then the "else" clause kicks in if it does not. Simple for me and that is what I need. : ) Thank you very much for your help! Sometimes one just needs a wall to bounce thoughts off of instead of pounding the head into. : ) Bob