From: Simon Cozens Date: 2002-10-22T02:14:10+09:00 Subject: Re: functional Ruby equiv to this perl snippet bobx@linuxmail.org (Bob) writes: > # parses a text file looking for server names and ignoring lines > # with start with the pound/hash sign. It's pretty bad Perl, so here it is translated into pretty bad Ruby... def load_server_list filename = "serverlist.txt" file = open(filename, "r") servers = [] while line = file.gets line.chop! next unless line =~ /\S/ next if line =~ /^#/ servers << line end file.close return servers end -- EFNet is like one big advertisement for lobotomies.