http://qs321.pair.com?node_id=73363


in reply to Control C in PERL?

Control-C is a special keyboard character caught by the terminal drivers. It passes the SIGINT to the foreground process. While it's easy to ignore this single character sequence as shown above, it may be better to use Curses to ensure that you ignore ALL input while your loop is running. Also, Curses can help you to "beautify" your output. Also, you could assign ^C a subroutine or some instructions to notify the user that the key is being ignored. The C docs will help you more than the perldocs, so look at man curs_inopts(3X). Good luck!
AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.

Replies are listed 'Best First'.
Re: Re: Control C in PERL?
by idnopheq (Chaplain) on Apr 18, 2001 at 06:54 UTC
    You can also use Term::ReadKey to help control the signals. This works better on Win32 systems for some reason.

    HTH
    --
    idnopheq
    Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.