From: Robert Klemme Date: 2004-09-17T00:29:52+09:00 Subject: Re: Ex-Perl coders: Howz it feel to convert to Ruby? "Nate Smith" schrieb im Newsbeitrag news:1095340527.2816.33.camel@circuit.eeel.nist.gov... > > Under which circumstances do you need to_s for numbers? What's wrong with > > this? > > > > >> puts 1 > > 1 > > => nil > > >> print 1, "\n" > > 1 > > => nil > > >> puts "foo #{1} bar" > > foo 1 bar > > => nil > > Try > > print "a" + 1 > > Won't work -- you have to do > > print "a" + 1.to_s I prefer to use #{} in those cases (see above, no. 3). Gives you more control. Of course, your example can be written much easier: print "a", 1 Kind regards robert