Use HotKey.pm; foreach $i (@things) { &program_running($i); while ($keyboard = readkey) { # This is the gotcha if ($keyboard =~ /b/) { print "you pressed b \n"; } } }