------ art_128411_21481344.1152678631312 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I should have to mention this problem explicitly. AFAIK, $/ is 'input record separator' while $\ is 'output record separator.' And the problem is: $ruby -e 'p "a"' "a" $ As you can see p is printing new line character. But the spec says that p is supposed to print 'output record separator' after printing out given arguments. Let's see what current output record separator is... $ruby -e 'p $\' nil $ Surprisingly, $\, output record separator, is nil while Kernel#p printed new line. So I guess one of the following holds: (1) p prints new line instead of output record separator. (2) Somehow, $\ is converted into newline while Kernel#p is running (3) $\ is not a output record separator, actually. Any idea? - Minkoo Seo On 7/11/06, Michael Fellinger <m.fellinger / gmail.com> wrote: > > On Tuesday 11 July 2006 16:16, Minkoo Seo wrote: > > Hi. > > > > ri Kernel#p shows this: > > > > --------------------------------------------------------------- Kernel#p > > p(obj, ...) nil > > ------------------------------------------------------------------------ > > For each object, directly writes _obj_.+inspect+ followed by the > > current output record separator to the program's standard output. > > > > S truct.new(:name, :state) > > s ['dave', 'TX'] > > p s > > > > _produces:_ > > > > #<S name ave", state X"> ave", state X"> > > > > But when I run the following: > > > > $cat tmp.rb > > print $\ > > $ ruby tmp.rb > > nil$ > > > > Namely, Kernel#p is expected to print 'current output record separator', > > but current output separator is just *nil*. > > > > What I've done in the wrong way here? Is the ri document written > wrongly? > > manveru@pi ~> irb > p $\ > nil > # nil > p $/ > "\n" > # nil > > guess you just have a typo there :) > remember, the $/ is a jedi that just waits to attack and to slice > output... > it's not the output being attacked :) > > stupid way to remember... but maybe it helps - imho one shoulnd't have to > remember that stuff anyway > > > > > Sincerely, > > Minkoo Seo > > ------ art_128411_21481344.1152678631312--