Hmmm... What I believe you're trying to do is "snoop" on the keyboard - log all entries, regardless of what program the user is using.
This wouldn't be possible in Perl (Well, I suspect *anything's* possible in Perl)- it would have to be implemented at the keyboard driver level,
or possibly using the tty snp device in *BSD - but then you get the program "watch" anyway.
Any solution that could be formed would also have to be strongly OS-dependent - eg, it might be relatively easy in *BSD because of the snp device,
but (I believe) you'd have to replace the keyboard driver in something such as Windows - Perl drivers anyone? ;-)