2006/06/04 21:36:44 child sleeping 2006/06/04 21:36:44 done printing #### use POE qw(Wheel::Run); use Log::Log4perl qw(:easy); Log::Log4perl->easy_init({ level => $DEBUG, file => ">>/tmp/wheel.log"}); POE::Session->create( inline_states => { _start => sub { my $w = POE::Wheel::Run->new( Program => sub { DEBUG "child sleeping"; $|++; print "foo\n"; DEBUG "done printing"; sleep 10; }, StdoutEvent => "captured", )}, captured => sub { my ($heap, $input, $wheel_id) = @_[HEAP, ARG0, ARG1]; DEBUG "Child process in wheel $wheel_id wrote to STDOUT: $input"; } } ); POE::Kernel->run();