#!/usr/bin/perl -w use strict; use Win32::Clipboard; use Text::Autoformat; my $clipboard = Win32::Clipboard(); $clipboard->Empty(); print "Text auto-format-clean when copied to the clipboard is active.\n"; print "To exit, CNTL-C out of this window.\n"; while (1) { $clipboard->WaitForChange(); my $text = $clipboard->GetText(); next if ($text eq ''); $text = autoformat($text, {all=>1}); # The magic kicks in. $clipboard->Set($text); } exit;