Advertisement

07.08.2008 at 04:44PM PDT, ID: 23548714
[x]
Attachment Details

Forking a processes in perl

Asked by Marketing_Insists in Perl Programming Language

How could I launch the below indicated line or any other block of code on all array parameters at once in a nonlinear method?  Basically cloning the block 5 times.

I've heard of heard of fork() and the win32::process module, but I can't clearly understand how to implement what I need to do with the samples given: (win32 perl by the way)

@array = qw{ server1 server2 server3 server4 server5 };

for (@array) {
   
    # How can I clone the below line 5 times instead of running sequentially?
      push(@out,( `ping -n 120 $_` ));

}

# output results
print @out;
Start Free Trial
 
Loading Advertisement...
 
[+][-]07.08.2008 at 04:58PM PDT, ID: 21959447

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.08.2008 at 05:00PM PDT, ID: 21959457

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.08.2008 at 08:59PM PDT, ID: 21960503

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628