Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: start up process without waiting

by exilepanda (Pilgrim)
on Dec 06, 2012 at 16:10 UTC ( #1007616=note: print w/replies, xml ) Need Help??


in reply to Re: start up process without waiting
in thread start up process without waiting

thanks for your updated with code demonstration. However I think there's no fork for windows. Anyway, I just resolved this in more shell way:
`start /B /I "" "$file"`;

Replies are listed 'Best First'.
Re^3: start up process without waiting
by kennethk (Abbot) on Dec 06, 2012 at 16:21 UTC

    While there is no fork() system call on Windows, your version of perl was likely built to emulate it using threads; thus the code I provided will work -- and was, in fact, tested on a Windows XP machine. See fork, perlfork and/or fork in perlport.


    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Re^3: start up process without waiting
by kennethk (Abbot) on Dec 06, 2012 at 16:30 UTC

    Also, as you are tossing away your return values, you should not be using backticks. Not only is your intent misleading, using system also buys you automatic escaping if you use the multiple argument form:

    for $file (@files) { system 'start', '/B', '/I', '', $file }

    #11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007616]
help
Chatterbox?
[Corion]: ambrus: Hurr - yes, that might happen, as Prima will queue lots of stuff (Well, Windows will)
[Corion]: But I'm really amazed that it just took this little code (plus the idle handler I have in mind and something else dk suggested)
[Corion]: ambrus: I wrote the handler so that it stops the timer if it's supposed to be a one-shot
[Discipulus]: are you using Prima Corion? good morning Corion and ambrus, btw

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2016-12-09 09:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (150 votes). Check out past polls.