# Ridiculously simple, but very useful. use Win32::Clipboard; my $text = Win32::Clipboard::GetText() or exit; Win32::Clipboard($text) if $text;