Re: How to continue process without waiting for the output of system()?



On Aug 30, 9:57 am, Cod <zen...@xxxxxxxxx> wrote:
For example , I wrote:

system("calc");
print "hello";

Before the calc program is closed, the print statement will not
excute.

Any way to change the behavior?
I have tried fork, and system("calc&"), all failed.

My OS is WinXP, and I use Active Perl 5.8.8.

Thanks for your help!

If you want to use threads this will work:
use strict;
use warnings;
use threads;


my $thread = threads->create(sub { thread()});
print "hello\n";
$thread->join();

sub thread{
system("calc");
1;
}

.



Relevant Pages