in reply to Re: Threads, Tk, Time, oh my!
in thread Threads, Tk, Time, oh my!

> the only (relevant?) use of Time::Piece is in PM::CB::Communication for the timestamp

Unfortunately, there's far more of Time::Piece in PM::CB::GUI.

Thanks for the recommendations and tips, I'll experiment with them and see.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^3: Threads, Tk, Time, oh my!
by Corion (Patriarch) on May 07, 2026 at 09:53 UTC

    Aah - yeah, this part looks fishy, or at least prone to trigger thread+locale-based conflicts:

    if (defined $time) { local $ENV{TZ} = 'America/New_York'; my $est = Time::Piece::localtime()->tzoffset; $time = 'Time::Piece'->strptime($time, '%Y-%m-%d %H:%M:%S') - $est + $tzoffset; } else {

    Manipulating the timezone is weirdly(?) not threadsafe, or at least that's what I remember from some Perl tickets.

    Update: You could calculate the timezone once at program startup, that could eliminate the switching of the timezone within a thread.