in reply to loop inside system command

If I understand your question correctly, you'll need to execute system singularly, and build your loop around it, as opposed to in it
foreach ($firstbuild, @otherbuilds) { system (qq(C:/execu $_ file.c)); }
One thing you may consider, esp. if @otherbuilds can grow to be sufficiently large: system is a double fork, in terms of processes spawned. One proc. for the system call, one for the actual command to run. If you're going to be calling system on more than a couple of items, you may consider doing something like so:
open (OUT, ">cmd.txt") || die "$!\n"; foreach ($firstbuild, @otherbuilds) { print OUT "C:/execu $_ file.c\n"; } close OUT; system ("cmd.txt");
The reason? Instead of spawning 2N processes, you'll spawn only N+1. 3 or 4 system calls probably doesn't warrant the extra work. If you got 100 or so...well, you get the picture.

ÅßÅ×ÅßÅ
"It is a very mixed blessing to be brought back from the dead." -- Kurt Vonnegut

Replies are listed 'Best First'.
Re: Re: loop inside system command
by DS (Acolyte) on Jul 17, 2002 at 14:24 UTC
    thanks to you all :)