in reply to Re^5: $SIG{ALRM} and windows vista?
in thread $SIG{ALRM} and windows vista?

On Windows Vista, your code doesn't do anything useful. Specifically, your code fails to display the message "Enter your password:" and then wait for the user to enter their password. Instead, your code does nothing, then prints out "Enter your password: you timed out."

In an effort to get "Enter your password: " to display immediately, I tried setting the output buffer to flush output immediately by setting $| = 1, but that didn't change the result.

Replies are listed 'Best First'.
Re^7: $SIG{ALRM} and windows vista?
by BrowserUk (Patriarch) on Jan 04, 2010 at 20:37 UTC
    On Windows Vista, your code doesn't do anything useful.

    It does! It demonstrates that alarm works, when the operation, (sleep in this case), doesn't involve IO. Ie. The sleep 10; was interupted by the alarm 5. And that was the only reason I posted it.

    For a solution to your problem that works, see Term::ReadKey


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
Re^7: $SIG{ALRM} and windows vista?
by ikegami (Patriarch) on Jan 04, 2010 at 20:40 UTC

    Instead, your code does nothing, then prints out "Enter your password: you timed out."

    As it should. His code demonstrates that alarm will interrupt sleep on Windows.