Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Can I run a piece of code like child process?

by OzzyOsbourne (Chaplain)
on Oct 03, 2000 at 22:18 UTC ( [id://35164]=note: print w/replies, xml ) Need Help??


in reply to Can I run a piece of code like child process?

I honestly have not checked the overhead on win32::process, and most people seem to be against it but I use:
use Win32::Process; @servers=('server1','server2','server3'); sub ErrorReport{ print Win32::FormatMessage( Win32::GetLastError() ); } foreach $server (@servers){ Win32::Process::Create($ProcessObj, "c:\\perl\\bin\\perl.exe", "perl.exe c:\\script.pl -s$server", 0, NORMAL_PRIORITY_CLASS, ".")|| die ErrorReport(); #$ProcessObj->Suspend(); #$ProcessObj->Resume(); #$ProcessObj->Wait(INFINITE); }
With the wait remmed out, the sub will not wait for the process.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2024-03-19 02:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found