From: "Shannon Fang" <xrfang / hotmail.com>

> Hi
> 
> I tried String.methods-Kernel.methods in irb, found that most methods of 
> String are inherited from Kernel. I don't know for methods like sub, gsub, 
> split, strip, chomp... Are they String specific? Why they exist in Kernel?
> 
> Thanks!
> Shannon


Kernel::X often translates to
  $_.X           ($_ is a String) or
  $<.X or $>.X   ($< and $> are IO)

So, instead of
  while line = STDIN.gets
    STDOUT.puts line.chomp
  end

you can get all Perly and write
  while gets
    puts chomp
  end

Nah, stuff that!  Go
  puts chomp while gets

See?  Examine the Kernel module in Pickaxe/ri for more details.

Gavin