in reply to ClearCase Programming
What about just executing both commands in a single system() command?
my $cmd = "/usr/atria/bin/cleartool"; my $status = system("$cmd setview $view ; cp $file1 file2");
In that case, both commands will be run by the same shell, and any environment set up by the first command will be available to the second. Also, the second command won't execute before the first has finished (as usual, shell commands separated by ';' are being executed in sequence — unless they fork themselves in the background (which I don't presume ct setview is doing...)).
Or maybe
my $status = system("$cmd setview $view && cp $file1 file2");
in which case the second command will only execute if the first succeeded.
(Essentially, you've then (dynamically) written a little shell script which you simply call from Perl.)
|
|---|