Krist van Besien wrote:
The code works insofar that it waits 5 seconds and than proceeds with
the default I set, but it completely ignores any keypresses I make.
It is as if STDIN is not available at the time this code runs.
If I replace the ReadKey(5) with a ReadKey(5,STDIN) I get a syntax error.


I suspect that apache may be closing STDIN before it reads the config. Maybe.

You could try:

close(STDIN);  # just in case
open(STDIN,"/dev/tty");
ReadMode('cbreak');
print "Press a key\n";
while (1) {
  $key = ReadKey(-1);
  if($key) {
    print "got $key\n";
    last;
  }
}
ReadMode('restore');

Rob

Reply via email to