in reply to keyboard input during runtime...

Since you're running on Unix and not Win32, this solution will work for you.

What you want to do is to select on STDIN every so often. Say, every time a certain loop starts over or every section or whatever. The code you're looking for is:

# Whenever you want to actually see if there's something waiting my $rin = ''; my $input = ''; vec($rin, fileno(STDIN), 1) = 1; $input = <STDIN> if select($rin, undef, undef, 0.1);
That should work. It's best if you write a subroutine and return either undef (if nothing) or what was read. You can even chomp in the subroutine, as well.

Oh - you'll have to hit RETURN so that the filesystem can pass in the values. There's no native keypressed-type thing. (You can get it with Term::ReadLine and the like, but that's more complex than I think you want.)

And, this will not work under Win32 without significant changes, due to how select is implemented there. Unless you're planning on migrating, don't worry about it. :)

------
/me wants to be the brightest bulb in the chandelier!