in reply to Problem with Windows Console input
Hello anshulzunke, and welcome to the Monastery!
It seems that when the Win32::Console object $StdIn is destroyed, it closes the STDIN filehandle. The solution would be to re-open STDIN in some way. Unfortunately, I don’t know how to do this.
A possible workaround is to keep $StdIn in existence. For example:
... use feature 'state'; ... sub readPasswordWindows { ... state $StdIn = Win32::Console->new(STD_INPUT_HANDLE); ...
This is a kludge, but it does keep STDIN open and so remove the error, allowing the script to run as intended.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problem with Windows Console input
by Anonymous Monk on Feb 24, 2014 at 05:35 UTC | |
by BrowserUk (Patriarch) on Feb 24, 2014 at 06:02 UTC | |
by Athanasius (Archbishop) on Feb 24, 2014 at 09:05 UTC | |
by BrowserUk (Patriarch) on Feb 24, 2014 at 16:49 UTC | |
by Athanasius (Archbishop) on Feb 25, 2014 at 03:56 UTC | |
by Anonymous Monk on Feb 24, 2014 at 11:47 UTC | |
by Anonymous Monk on Feb 27, 2014 at 11:31 UTC | |
by BrowserUk (Patriarch) on Feb 27, 2014 at 11:43 UTC |