use Tk ':variables'; ... # It handles right-clicks on all entries of the main window $mwindow->bind("Tk::Entry", "", sub {$popup->Popup( -popover => "cursor", -popanchor => 'nw' )} ); # It makes the menu row 'Copy' and calls the sub callback my $popup = $mwindow->Menu( -tearoff => 0, -menuitems => [ ['command' => "~Copy", -command => \&callback] ] ); # It must copy the content of the event's entry to the clipboard, but... sub callback { my $f = $Tk::event->ENTRY; # what instead of ENTRY? which method? (A, B...) my $g = $f->get(); $mw->clipboardAppend($g); }