#!/opt/homebrew/bin/perl use strict; use warnings; use Tk; my $main = new Tk::MainWindow(); my $entry_test = $main->Entry(-text => "single-quotes: ’'")->pack(); my $btn_test = $main->Button( -text => ' Test ', -command => sub { my $text = $entry_test->get(); &msg($main, $text) if ($text); } )->pack(); sub msg { my ($parent, $msg) = @_; print STDERR "Messaging: $msg\n"; $parent->messageBox( -title => 'Event', -message => $msg, -type => 'ok', -icon => 'info' ); } MainLoop();