use Term:ReadKey; $str=""; while (need_more_data($str)) { $str.=ReadKey(0);} $bad_data=ReadKey(0.5); # fractional values are accepted here