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, |
In reply to Re: Problem with Windows Console input
by Athanasius
in thread Problem with Windows Console input
by anshulzunke
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |