From: Dave Thomas Date: 2000-03-06T08:24:18-06:00 Subject: [ruby-talk:01753] Re: Perl => Ruby "Dat Nguyen" writes: > How to write the following Perl code in Ruby: > > while (<>) { eval; print $@; } It isn't as concise, as Ruby returns eval errors as exceptions: while gets begin eval $_ rescue puts $! end end You might also want to have a look at sample/eval.rb in the distribution. If you want an interactive way to execute Ruby, you might also want to check out 'irb'. Regards Dave