in reply to Re^3: Buffering issue with \r (backslash r)?
in thread Buffering issue with \r (backslash r)?

I forgot that <> reads lines (or more accurately, readline or glob, as you pointed out). Rather, I thought it would just read the input as it came. And since I set autoflush for STDOUT, I expected to get it in real time.

Thanks again!

Replies are listed 'Best First'.
Re^5: Buffering issue with \r (backslash r)?
by ikegami (Patriarch) on Oct 27, 2009 at 17:01 UTC

    Only sysread returns characters as it receives them. read returns when the specified number of characters have been read, and readline returns when an end of line marker is found. (Reaching the end of file or encountering an error will have them return before that, of course.)

    I forgot that <> reads lines (or more accurately, readline or glob, as you pointed out).

    glob doesn't read files. I pointed out that <> can be a shortcut for glob, not that glob reads lines.