Perl Question - Assynchronousness
Angel Rodriguez
angel at tierrasaltas.net
Fri Oct 26 06:25:06 PDT 2007
Hello James,
Friday, October 26, 2007, 3:21:59 AM, you wrote:
> I have a perl script which scavenges file off a network share and then
> formats and feeds them in an ERP system.
> What I would like to do is at the moment I feed the file into the ERP I
> would like to run another perl script which will wait for 10 seconds and
> then check to see that the ERP has spat the correct information out.
> However I want the calling script to continue processing after it calles
> the called script.
> I have been looking at system() but am unsure of how to tell it to
> launch the script and just keep going without waiting for a reply.
> Any ideas?
Maybe you can start a new thread with the ERP check and then detach it. Roughly:
use Thread;
my $t = Thread->new(\&start_sub, @start_args);
$t->detach;
detach tells a thread that it is never going to be joined i.e. that all traces of its existence can be removed once it stops running. Errors in detached threads will not be visible anywhere - if you want to catch them, you should use $SIG{__DIE__} or something like that.
ar
> _______________________________________________
> Linux-users mailing list ( Linux-users at linux-sxs.org )
> Unsub/Password/Etc:
> http://mail.linux-sxs.org/mailman/listinfo/linux-users
> Need to chat further on this subject? Check out #linux-users on irc.linux-sxs.org !
More information about the Linux-users
mailing list