in reply to Input/Output Problem

I think there's only one *portable* way of performing a non-blocked read which is using Term::ReadKey. So, you might want to give it a shot.

acid06
perl -e "print pack('h*', 16369646), scalar reverse $="

Replies are listed 'Best First'.
Re: Re: Input/Output Problem
by dragonchild (Archbishop) on Sep 10, 2001 at 16:50 UTC
    There's two different types of "portable" here. (Well, one's portability and the other's extensibility, but it's Monday and I like making words dance for me.)

    Term::ReadKey is portable across platforms, like Unix vs. Windows, if you know you will only want I/O from the keyboard.

    If you're on Unix and may want input from a socket as well as the keyboard, you can use select and bind STDIN and a socket. There are a few nodes that deal with this. (I'm lazy ... you can use SuperSearch. *grins*)

    If you want to be completely portable in both ways, then you can finagle the select on Windows if you're willing to telnet to yourself. (Again, there's a node on this somewhere on the monastery. *winks*)

    ------
    We are the carpenters and bricklayers of the Information Age.

    Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.