system waits for its external command to complete. If you want to continue executing the script oblivious of the progress of the system call, you will have to fork off your system call. Here's a cheap and dirty example:

if( fork() == 0 ) { system( "C:\\block.exe" ) or die "Command failed: $!\n"; exit; } print "processing second line...\n";

It's important to keep track of who is the parent and who is the child. fork() returns '0' to the child process, and the child process's ID to the parent. So the if(){} test I've used detects whether a given process is the child (in which case it executes the system command and then exits), or the parent (in which case it continues on to the next line). I could have used exec instead of system, but wanted to provide a way to gracefully handle external command failure. See fork, perlfork, and in a broader sense, perlipc for additional info and discussion of some of the fork pitfalls and handling processes.


Dave


In reply to Re: How to skip to next Command line by davido
in thread How to skip to next Command line by l.frankline

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.