use Term::ReadKey; # ... do some stuff to the filehandle COMPORT ... # ... do the command that gives the long response ... # Clear the remaining input while (defined(ReadKey(0.1,COMPORT))) {} # ... do some other command ... #### -- @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/