Code as simple as:
use Tcl::pTk;
my $mw = MainWindow->new();
my $lab = $mw->Label(-text => "Hello world")->pack;
my $btn = $mw->Button(-text => "test", -command => sub {
$lab->configure(-text=>"[". $lab->cget('-text')."]");
})->pack;
MainLoop;
I love the module Tcl::pTk as it gives me access to the GUI TclTk which on a macOS is great. And as far as I can tell, it works great too.
For the moment I commented out in pTk.pm the line $Tcl::pTk::library = Tk->findINC('.') unless (defined($Tcl::pTk::library) && -d $Tcl::pTk::library); and it seems to work fine. BUT as I really do not know what this lines is there for AND I do not like the idea to modify the module, I do not feel very well about this solution.