in reply to Re^2: System call
in thread System call

Generally that's the idea - the output of `system call here` ends up in $junk ..

But if `system call here` is a process - like a Matlab command - that creates an output file on its own, unless it writes the same output to STDOUT, you will likely not get it back in $junk.

You definitely have to experiment, and note that the system command acts differently in that regard to the backticks or qx//.

You can see the difference by running these two commands...
perl -e 'use strict; my @n = qx!/bin/netstat -a|grep LISTEN|grep -v un +ix; sleep 4!; print $_ . $/ for @n;'
and
perl -e 'use strict; my @n = system("/bin/netstat -a|grep LISTEN|grep + -v unix; sleep 4"); print $_ . $/ for @n;'
update - Unless of course, you are on Windows, then netstat and sleep probably won't work..

Notice when using system(), @n gets printed right away, and with qx// the script waits until the external commands are done..

If you do $junk = `system call here`;.. $junk will probably contain the Matlab command's exit code.. and you can then go open the new file A.