Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Simple Perl "Shell" Script on Windows XP to Run Multiple, Simultaneous Processes in Parallel

by jrsimmon (Hermit)
on Jul 29, 2009 at 03:52 UTC ( [id://784114]=note: print w/replies, xml ) Need Help??


in reply to Simple Perl "Shell" Script on Windows XP to Run Multiple, Simultaneous Processes in Parallel

Something like this?

use strict; use warnings; my $cmd = 'some_command'; my @args = qw(arg1 arg2 arg3 ... argN); system("$cmd $_) foreach @args;

The doc on the system call:
system

  • Comment on Re: Simple Perl "Shell" Script on Windows XP to Run Multiple, Simultaneous Processes in Parallel
  • Download Code

Replies are listed 'Best First'.
Re^2: Simple Perl "Shell" Script on Windows XP to Run Multiple, Simultaneous Processes in Parallel
by Jim (Curate) on Jul 29, 2009 at 04:29 UTC

    Thanks, but where's the background execution part?

    Jim

      You can modify it to:
      system("$cmd $_ &") foreach @args;
      The "&" starts the process in the background.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2025-02-16 11:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found