my $x = 0; my $c; while ( 1 ) { $c = ReadKey 0; last if $c !~ /^[0-9]$/; $x = 10 * $x + $c; } return -1 if $c ne ';';