From: "Skye Shaw!@#$" Date: 2010-12-28T05:00:18+09:00 Subject: Re: Peek at $stdin On Dec 27, 11:06 am, Ammar Ali wrote: > On Mon, Dec 27, 2010 at 8:12 PM, Intransition wrote: > > Any way to peek at the first character of $stdin without actually > > consuming it? I assume you don't want to look at the first char as soon as it's typed > What about IO#getc and IO#ungetc. On versions < 1.9 these will only read bytes, regardless of $KCODE. What's a reasonable alternative, $stdin.readline.chars.to_a[0] ?