Skip to content

Instantly share code, notes, and snippets.

@asiamoth
Created October 30, 2011 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save asiamoth/1325879 to your computer and use it in GitHub Desktop.
Save asiamoth/1325879 to your computer and use it in GitHub Desktop.
クリップボードにコピーした文字列から重複した行だけを削除する!
#!/usr/bin/perl
use strict;
use warnings;
use Tkx qw( clipboard );
my $text = Tkx::clipboard('get');
$text = do {
my %count;
join "\n"
=> grep { !$count{$_}++ }
split m{ \n }msx, $text;
};
Tkx::clipboard( 'append', $text );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment