I'm using this script to write anything copied to the clipboard to a file however I want to be able to turn it off/on using 'Ctrl-whatever' and do other options in the program as well (ie.. When I hit ctrl-a then write to file 'A'; when I hit ctrl-b then write to file 'B'; ctrl-c, popup a cmd window for entering text etc.). I'm on WinXP and its running from start-up and in the background using wperl.
my $outputfile = 'c:\perl\log.txt';
my $clipboard = Win32::Clipboard();
open (OUT, ">>$outputfile") || die "Could not open $outputfile";
my $text = $clipboard->GetText();
print OUT $text,"\n\n";