#!/usr/bin/perl -w use strict; use Win32::Clipboard; my $clipboard = Win32::Clipboard(); 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(); $text =~ tr/\r\n/ /; while ($text =~ s/ / /g) {}; $text =~ s/^ //; $text =~ s/ $//; $clipboard->Set($text); } exit;