L
Lars Eighner
I'm using perl 5.8.8 on FreeBSD.
I understand that getc() defaults to STDIN when an argument is not
specified, and getc() does not work until ENTER is hit at the keyboard
(i.e. STDIN). However, on the second call to get(), it appears I
get the next character from the same line (which might be the
newline from the ENTER, or might be 'e' if 'yes\n' was typed instead
of 'y\n'.
What's the right way to throw away the junk from the previous line?
I understand that getc() defaults to STDIN when an argument is not
specified, and getc() does not work until ENTER is hit at the keyboard
(i.e. STDIN). However, on the second call to get(), it appears I
get the next character from the same line (which might be the
newline from the ENTER, or might be 'e' if 'yes\n' was typed instead
of 'y\n'.
What's the right way to throw away the junk from the previous line?