From: Sean Russell Date: 2002-02-22T02:18:50+09:00 Subject: Re: Perl IO to Ruby IO help needed Craig Files wrote: > open (DEF, "<$input_def") || die "$0: cannot read $input_def\n"; > $/ = undef; # read the entire file... > $_ = ; # ...into memory > close(DEF); Tobias and Mike both gave you nice examples with exception handling; in the most simple, direct from perl translation: lines = IO.readlines(input_def) This does everything you do in your perl code; it dies (with an exception) if there is an error, and (AFAIK) the stream is automatically closed after reading. It's also only one line long, and much easier to understand :-) -- SER