in reply to How can I run a piece of code asyncronously in Perl?
use threads; async { `t1.pl "arg1" "arg2" "arg3"`; }->detach; print "DONE\n";
Note: It doesn't make much sense to use backticks if you do nothing with the returned output; but that's not the subject of the question.
And having the first script end immediately after starting the second doesn't make much sense in isolation either -- why not just run the second script directly. But I assume this is just a generic example to satisfy the "where's your code" crowd.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How can I run a piece of code asyncronously in Perl?
by Doctrin (Beadle) on Nov 02, 2012 at 19:43 UTC | |
by BrowserUk (Patriarch) on Nov 02, 2012 at 20:04 UTC |
In Section
Seekers of Perl Wisdom