You're probably running into a common problem on Windows ... which is that because the program is normally graphical, it spawns off from CMD.EXE into a background process allowing CMD.EXE to be freed up to run something else.
Solution 1: if Matlab has an option (commandline option, perhaps) to prevent this, use it. Not really a perl solution, but we're just looking for a solution you can use in perl, right?
Solution 2: Eliminate CMD.EXE. To do this, you need to use the array form of system rather than the single scalar method. So, rather than calling system("matlab -run matlab.input") ... try calling it as system(qw(matlab -run matlab.input)). This may not quite work - you may have to pass in a full pathname to matlab: system('c:/program files/matlab/matlab.exe', qw(-run matlab.input)). Note how I pulled the command out of the qw so that I could put a space in it - may be useful for you.
Of course, if you don't know ahead of time where to find matlab, you're going to have to look in $ENV{PATH} (File::Spec has a good way to get this as an array that you can look through, and I'm sure there's a module out there that can look it up for you, too).
Hope this helps
In reply to Re: System call
by Tanktalus
in thread System call
by newuser_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |