From: Roel Harbers Date: 2007-03-12T22:09:48+09:00 Subject: Re: ruby 1.8.5p12: default IO object for gets() ? Unknown wrote: > How many more quirks like that exist? It might be a bit quirky, it took me by surprise too. However, it's right there in the documentation. > I feel it a bit unnnatural. unprefixed gets/puts etc should use > $stdin,$stdout only. Since usualy you use other IO objects to access > open files or sockets. > > Is it going to be changed maybe? Not likely. Quite a lot of scripts use it to easily allow input from either stdin or a file, without having to bother with opening files. So, you can either do someexecutable | myscript.rb or myscript.rb inputfile without any extra work, which can be convenient for simple scripts. Regards, Roel Harbers