Take a look at the non-blocked reading mode in Term::ReadKey. For example:
#!/usr/bin/perl use warnings; use strict; use Term::ReadKey; while(1) { #do some stuff print "Did something\n"; sleep 5; if (my $line= ReadLine -1) { print "Got this command: $line"; } }
In reply to Re: Reading terminal input while program is running
by tirwhan
in thread Reading terminal input while program is running
by minixman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |