"Austin Ziegler" <austin / halostatue.ca> wrote in message
news:20021021174531.ZWLH5548.tomts9-srv.bellnexxia.net / hogwarts...
<snip>
> contains that information.
>
> def load_server_list
>     servers = []
>     File.open('serverlist.txt').each do |line|
>         next unless line =~ /^\S+$/
>         next if line =~ /^#.*$/
>         servers << line.chomp.sub(/\s+#.*$/, '')
>     end
>     servers
> end
>
> servers = load_server_list
> p servers.size, servers
Cool..but what if serverlist.txt does not exist? The one thing I do like
about Perl is the "open file or die" test. I believe that I am "stuck" with
a rescue clause which is sometimes confusing for me (a newbie) to use when
it is located within a "def".

Bob