From: ts Date: 2003-09-04T00:15:03+09:00 Subject: Re: Kernel.const_get and gets >>>>> "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 ^^^^ command line. Returns nil at end of file. The optional argument specifies the record separator. The separator is included with the contents of each record. A separator of nil reads the entire contents, and a zero-length separator reads the input one paragraph at a time, where paragraphs are divided by two consecutive newlines. If multiple filenames are present in ARGV, gets(nil) will read the contents one file at a time. ARGV << "testfile" print while gets produces: This is line one This is line two This is line three And so on... svg% If you give it arguments, it will try to read from these files You want IO#gets rather than Kernel::gets Guy Decoux