use Term::ReadKey; use Time::HiRes qw(time); #....... sub slow_print { my $subscript = shift; my $para = $paras[ $subscript ]; if ( $rewrap_margin ) { $para = &rewrap( $para ); } my @lines = split /\n/, $para; foreach ( @lines ) { print $_ . "\n"; my $thispause = $pause_len * length $_; ReadMode 3; # 'noecho'; print STDERR "should be sleeping for $thispause secs\n" if $debug; my $key; my $wait_until = time + $thispause; while ( time < $wait_until ) { $key = ReadKey( -1 ); if ( defined $key ) { print STDERR "keystroke $key\t"; &handle_keystroke( $key ); } } } print "\n\n"; }