From: Colin Bartlett Date: 2010-09-03T04:46:59+09:00 Subject: Re: p vs. print --0016365ee8a8a34292048f4c1326 Content-Type: text/plain; charset=ISO-8859-1 On Thu, Sep 2, 2010 at 8:40 PM, Quintus wrote: > Am 02.09.2010 21:23, schrieb Alex Stahl: > > Ruby uses "puts", not "print". "p" is short for "puts". > > Try this: > > puts ary1 > > You'll get the same results as: > > p ary1 > > This is definitely wrong. #p is quite another method than #puts and yet > another than #print. Look at this ... And as another example of the differences: class P def inspect(); "P#inspect"; end def to_s(); "P#to_s"; end end q = P.new puts "p" p q #=> "P#inspect" puts "puts" puts q #=> "P#to_s" puts "print" print q puts ":: just after print" #=> "P#to_s:: just after print" --0016365ee8a8a34292048f4c1326--