From: Rasputin Date: 2003-09-04T00:18:42+09:00 Subject: Re: Kernel.const_get and gets * ts [0915 16:15]: > >>>>> "R" == Rasputin writes: > R> Using Kernel.const_get() to dynamically create instances seems > R> to screw up their idea of STDIN. I'm probably missing something > R> obvious, please can someone enlighten me? > it has nothing to do with const_get, remove the line > > ARGV.each { |c| dynamic << Kernel.const_get(c).new } > > and you'll see that you have the same error > > > R> puts gets > ^^^^ > the problem is here > > svg% ri Kernel::gets > ----------------------------------------------------------- Kernel::gets > gets( aString=$/ ) -> aString or nil > ------------------------------------------------------------------------ > Returns (and assigns to $_) the next line from the list of files in > ^^^^^^^^^^^^^^^^^^^^^^^^^ > ARGV (or $*), or from standard input if no files are present on the > ^^^^ KERRRR-CHUNK. (sound of very large penny dropping). Thank you very much indeed. > svg% > > If you give it arguments, it will try to read from these files > > You want IO#gets rather than Kernel::gets -- Nobody can be exactly like me. Sometimes even I have trouble doing it. -- Tallulah Bankhead Rasputin :: Jack of All Trades - Master of Nuns