I have Perl Tk application which uses a repeater (mw->repeat).
The repeater is calling a function which refreshes some Tk objects inside the GUI.
This repeater function is taking some time to execute - hence it freezes the application for several seconds. I'm also storing objects inside hashes and therefore I'm trying to configure "complex" data structures inside the repeater.
I've been looking for a way to execute this function on the background (possibly thread?) but unfortunately I could not make it.
I understand that I need to use threads::shared. However, when I'm trying to assign the objects into the hash it won't let me, saying "Invalid value for shared scalar".
One of the experiments I've tried:
#main
our %hash :shared;
my %p,%p2;
$hash{$key} = \%p;
$hash{$key}{$key2} = \%p2;
$hash{$key}{$key2} = Button(...)
#inside the repeater - with threads
$hash{$key}{$key2}->configure(-text => "foo");
What do I miss here?
Thanks.