From: Bob X Date: 2002-10-22T18:56:33+09:00 Subject: Re: What I did (was Re: functional Ruby equiv to this perl snippet) wrote in message news:Pine.LNX.4.44.0210212217300.26314-100000@candle.superlink.net... > Hi -- > > On Tue, 22 Oct 2002, Bob X wrote: > > > 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| > > Just to point out that you're introducing a wee race condition, > because it's possible for the file to be deleted (by another process) > between the exist? test and the open. This may not be a practical > consideration in this case, but it's probably not a good construct to > use in general. I had not thought of that actually. I will be the user of the script but I guess you never know where they actually can go. Bob