T'is easy.
#!/usr/bin/perl -w use IO::Socket; use strict; use threads; use threads::shared; #sock is my connection where I report what is going on my $sock = IO::Socket::INET->new( PeerAddr => 'hostname.org', PeerPort => '1234', Proto => 'tcp' ); my $done:shared = 0; my $thread = async{ long_running_function(); $done = 1 }; print $sock "I'm still here" and sleep 180 until $done; my $return_value = $thread->join; print $sock "$return_value\n"; close $sock;
In reply to Re: How to break up a long running process
by BrowserUk
in thread How to break up a long running process
by markh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |