in reply to Keylogging

Keylogging can be done at various levels under Win32, the easiest being messages sent to your window handle (so you have one), the common way is to install a Window Hook, something which is not easily done from Perl (or, to be more specific, it's easy to install such a hook, but nearly impossible to create code that can be called asynchronously from the Windows kernel whenever a key event occurs).

If you are thinking about capturing keystrokes and then playing them back to automate an application (which in fact is the only legitimate reason you would want to do "keylogging" at all), Window Hooks are the way to go, but it's a stony road, even if you're armed with C or a comparable low level language.

If you need to do keylogging to spy on somebody entering his super secret password (FBI style), the simplest methods are still social engineering, shoulder surfing and making the gift of a wireless keyboard, and having a second receiver nearby plugged into a PC with Notepad.exe logging all keystrokes.