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

In reply to Re: loop inside system command by abaxaba
in thread loop inside system command by DS

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.