$my wait_time = XX :shared; ... $heap->{update_config_threads} = POE::Component::Pool::Thread->new( # Only one thread at a time...just needs to be nonblocking for other stuff MinFree => 1, MaxFree => 1, MaxThreads => 1, StartTheads => 1, Name => 'UpdateThread', EntryPoint => \&update_child, CallBack => \&update_result_handler, ); $kernel->delay(config_check => $wait_time); }, got_input => sub { my ($kernel, $heap) = @_[KERNEL, HEAP]; my $input_line = $_[ARG0]; #print "DEBUG: \$input_line = $input_line\n"; $kernel->post(InputThread => run => $input_line); }, config_check => sub { my ($kernel, $heap) = @_[KERNEL, HEAP]; # Pass $kernel in so callback handler can get it and post new $kernel->delay after we're finished $kernel->post(UpdateThread => run => ($kernel, $config)); }, } ); sub update_child { my ($kernel, $input) = @_; # BUILD_NEW_CONFIG HERE return ($kernel, $new_config); } sub update_result_handler { my ($kernel, $config = @_[ ARG0, ARG1 ]; # COPY_CONFIG_TO_SHARED_VAR HERE # Then post new $kernel->delay for next update check $kernel->delay(config_check => $wait_time); } #### Invalid value for shared scalar at /usr/local/share/perl/5.8.7/POE/Component/Pool/Thread.pm line 183.