count! = 0 DO datain$ = INKEY$ count! = count! + 1 LOOP UNTIL LEN(datain$) > 0 PRINT count! #### use strict; use warnings; use diagnostics; my $count = 0; my $char; until (sysread STDIN, $char, 1) { $count++; } print $count; #### use strict; use warnings; use diagnostics; use Term::ReadKey; my $count = 0; my $char; ReadMode('cbreak'); while ($char eq "") { $char = ReadKey(0); $count++; } print $count;