#!/usr/bin/perl use warnings; use strict; use Tk; # a "phantom newline"-free copy'n'paste to # the mouse clipboard my $mw = tkinit; my $textbox = $mw->Text(); #never packed $mw->Button(-text =>'CLipAppend', -command=>sub{ $textbox->clipboardClear; $textbox->delete('1.0','end'); $textbox->insert('end','foobarz'); $textbox->selectAll; #this next line must come after the selectAll $textbox->delete('end - 1 chars','end'); $textbox->clipboardColumnCopy; print chr(07); #beep })->pack(); MainLoop;