in reply to Re: keyboard input during runtime...
in thread keyboard input during runtime...

I cannot really recommend this approach.

If a second INT signal is received, zap will be called again. Since the housekeeping involves opening and writing to files things will start to go a little bezerk, since you will have two (or more) paths of execution running asynchronously. If files are being appended to, the results will be disastrous. Try running the following code:

#! /usr/bin/perl -w use strict; my @a = (1..200000); $SIG{INT} = sub { open OUT, '>>logfile'; foreach( @a ) { print OUT "$_\n"; } close OUT; exit; }; 1 while 1;

If you feed this an INT signal, followed by another one in less than the time it takes to write out the file you will some very interesting results in the logfile...

--
g r i n d e r