http://qs321.pair.com?node_id=106651


in reply to Clipboard to file

Try this. It will time tag and append each clipboard change to a file.
#!/bin/perl -w use strict; use Win32::Clipboard; use FileHandle; my $clipboard = Win32::Clipboard(); #open the log file my $file = 'c:\temp\clip.txt'; open(OUTPUT,">>$file") or die "open: $!"; binmode OUTPUT; autoflush OUTPUT 1; print "Clipboard being saved to $file\n"; print "To exit, CNTL-C out of this window.\n\n\n"; while (1) { $clipboard->WaitForChange(); my $text = $clipboard->GetText(); my $now = localtime(); print "$now: writing " , substr($text,0,40) , "... to $file\n"; print OUTPUT "$now\n$text\n"; } exit; END { close OUTPUT or die "close: $!"; }