I've written a
Perlprogram which accepts a password at a
DOSprompt on a
Win32platform, and so to control
TTY ECHOI've used
Win32::Console. That worked great. But when the console control object goes out of scope, all inputs are immediate and blank (i.e.,
$geninp = <STDIN>;doesn't wait for actual keyboard input, it merely exits and
$geninpis either blank or
undef; I haven't tested to see specifically which).
I've worked around the problem by using ourinstead of my to define the console control object scalar, but this doesn't feel like a graceful solution. Namespace pollution, anyone?
I've tried to use the Win32::Console::free()and similar methods to get it to release the object more gracefully in hopes it would return console behavior to its default, but the results are the same as simply letting the object go out of scope -- default behavior is not reinstated and the results are unusuable.
I'm curious if this is a one-way street; in other words, once you start using Win32::Consoleto do console work, are you simply stuck with it until the end of the script?
Anyone with Win32::Consoleexperience out there have any insight to share on the matter?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.