Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: detached process in windows

by BrowserUk (Patriarch)
on Jun 19, 2006 at 10:53 UTC ( [id://556221]=note: print w/replies, xml ) Need Help??


in reply to detached process in windows

The simplest way is to use the barely documented system-with-a-first-argument-of-1 asynchronous system. It's not portable outside of Win32, but it is roughy analogous to appending '&' to the end of a unix command.

#! perl -slw use strict; if( @ARGV ) { print 'I am the child. I got args: ', join', ', @ARGV; sleep 10; print 'Child ended'; } else { print 'I am the parent'; for ( 1 .. 3 ) { print "Starting child $_"; system 1, $0, 'An arg', $_; } print 'Parent continuing'; sleep 10; print 'parent exiting'; } __END__ c:\test>junk I am the parent Starting child 1 Starting child 2 Starting child 3 Parent continuing I am the child. I got args: An arg, 2 I am the child. I got args: An arg, 3 I am the child. I got args: An arg, 1 parent exiting c:\test>Child ended Child ended Child ended

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://556221]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-03-29 12:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found