#!/usr/bin/perl -w
use strict;
use warnings;
use String::KeyboardDistance qw(qwerty_char_distance);
use Time::HiRes qw(usleep);
$|++;

my $input;
my $last_match = 'g'; # and why not?

{
  local $/ = undef;
  $input = <ARGV>;
}

$input =~ s/(.)/sleep_and_show($1)/esg;

sub sleep_and_show {
  print $_[0];
  usleep int rand(100_000) * qwerty_char_distance($_[0], $last_match);
  $last_match = $_[0];
}
