From: mirian@... (Mirian Crzig Lennox) Date: 2002-10-22T06:18:57+09:00 Subject: Re: functional Ruby equiv to this perl snippet On Tue, 22 Oct 2002 05:54:49 +0900, Bob X wrote: > >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". You can do something very similar in Ruby, using "fail" instead of "die". For example: def open_file name f = File.open(name) or fail "couldn't open #{name}" return f end --Mirian