I apoligize in advance, but company restrictions forbid me from posting any code. Even though I had to teach myself perl, I will try to make my request for wisdom as clear as possible.
I'm trying to write a script that calls 2 other perl scripts, then a MATLAB script followed by a 3rd perl script. I have no problem getting any of the programs to start and run correctly, but I can't seem to figure out how to make the last perl script wait until the MATLAB script is finished before it is called.
For error checking I decided to call MATLAB using system(), because I thought perl waits until the program is finished and assigns a value of 0 upon a succesful exit. What system seems to actually do is return 0 once MATLAB starts.
The goal is to automate these 4 tasks to run every night after my co-workers and I leave for the day. The MATLAB program and last perl script are very resource-intensive processes that take at least 4 hours each to complete. Because the present version of my script calls the last script before MATLAB is finished, both programs run at the same time and crash the system.
My question is, how can I force perl to wait until MATLAB is finished before calling the last program? I currently call MATLAB in background mode (the program does not load as a GUI like normal, and returns all results in a log file upon exit).
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.