in reply to Trapping for Control^Z
Keep in mind that you are not trapping ^C or ^Z: you are trapping the signal that the terminal is sending to your process.
If you really want to get the keys, try:
#!/usr/bin/perl -w use Term::ReadKey; ReadMode 4; while (($key=ReadKey(0)) ne 'Q') { print "Got key ",ord($key),"\n"; } ReadMode 0;
|
|---|