Here are a couple of ideas.
This one will let you put something into the Paste selection menu of many apps, but you need X windows running.
#!/usr/bin/perl
use warnings;
use strict;
use Tk;
use Tk::Clipboard;
my $mw = tkinit;
$mw->withdraw; #use Tk without showing a window
my $content = 'foobar'.time;
print "$content\n";
$mw->clipboardClear;
$mw->clipboardAppend($content);
MainLoop;
or this one will let you copy into the mouse paste buffer. Unfortunately, you need to keep the Tk program going untill you make the mouse Paste. The programs' Paste buffer gets cleared when Tk exits.
#!/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;
Perl Gtk2 has some similar things, google for "Gtk2::Clipboard"
|