From: Xavier Noria Date: 2010-09-07T07:27:09+09:00 Subject: Re: Problem with 'chomp' On Tue, Sep 7, 2010 at 12:11 AM, Barry O'gorman wrote: > Simple program: > > while($_ != "q") >    puts "Running..." >    print "Enter q to quit: " >    gets >    chomp > end > > However - getting the following in any progams in which I use 'chomp': > 'undefined local variable or method 'chomp' for main: Object (NameError) chomp, gsub, and others can only be used without a receiver in one-liners. They are thought for making -p loops and such short. In regular Ruby you normally use explicit variables (and in regular Perl you normally also do).