One way would be to use native system calls.
- Win32API::File's GetOsFHandle to get the underlying OS handle.
- ReOpenFile the handle with FILE_FLAG_OVERLAPPED.
- CreateEvent to create the event on which to wait.
- ReadFile to start waiting for data.
- WaitForSingleObject with a timeout to wait for input.
- CloseHandle to release the event and the file handle.
The system calls can be accessed via Win32::API and via other modules (such as Win32API::File and Win32::Event).
Update: Oh oops, I had suggested CreateFile, but that isn't applicable. Replaced with ReOpenFile.
| [reply] [d/l] [select] |
| [reply] |
Does Term::ReadKey work on Active State Perl? I know it works under Cygwin perl. If alarm and select are out, the only solution might be Term::ReadKey and busy waiting (i.e. have a loop which constantly checks the time and Term::ReadKey.)
| [reply] [d/l] [select] |
alarm doesn't work on Windows, at least not here. Neither does select with non-socket handles, so that's out too.
| [reply] [d/l] [select] |