From: Mark Slagell Date: 2000-12-10T03:14:25+09:00 Subject: [ruby-talk:6979] Re: output problem Anand Maheswar wrote: > ... > When I enter the following program into irb it works as expected, but when > run from the command line just returns me to my prompt--i.e., no output > whatsoever. I running Ruby 1.6.1 under window 2000 using a cygwin bash > shell. > > class Test > def initialize(numbers,numberPossible) > @numbers = numbers > @numberPossible = numberPossible > end > attr_reader :numbers, :numberPossible > attr_writer :numbers, :numberPossible > end > l = Test.new(6,54) > l.numbers > l.numberPossible > > Anand, irb displays as it evaluates--which is behavior you probably wouldn't want in general for all your programs. Explicitly print what you want to see. (use print, printf, puts, p, or whatever). Welcome - I hope you like ruby as you get familiar with it. Mark