Perl newbie - getting "system()" to return

J

Jean-Benoit MORLA

Hi,

I have to run 4 Windows XP Pro executables sequentially from a script.
Each executable has to be started after its predecessor.
I tried:

system( executable1 );
system( executable2 );

But the Command windows hangs until I kill the process from task
manager.
The second line never gets executed.
Also the script must not skip directly to the second line because each
executable needs the previous one to start up.
Is there another command in Perl than system()?
Many thanks
 
A

A. Sinan Unur

(e-mail address removed) (Jean-Benoit MORLA) wrote in
I have to run 4 Windows XP Pro executables sequentially from a script.
Each executable has to be started after its predecessor.
I tried:

system( executable1 );
system( executable2 );

But the Command windows hangs until I kill the process from task
manager.
The second line never gets executed.
Also the script must not skip directly to the second line because each
executable needs the previous one to start up.
Is there another command in Perl than system()?
Many thanks

If I am reading correctly, you are saying: I want to wait until
executable1 is finished before I launch executable2 but I don't want to
wait until executable1 is finished before launching executable2.

system waits until the external program it launches terminates. Maybe
you should look into why executable1 is not terminating.

On the other hand, if you would like system to return immediately after
launching executable1, you can launch it with start.

Note that this is not really a Perl question but rather a Windows
question.

Please read the posting guidelines for this group to learn how you can
others help you.

Sinan.
 
G

George

Jean-Benoit MORLA said:
Hi,

I have to run 4 Windows XP Pro executables sequentially from a script.
Each executable has to be started after its predecessor.
I tried:

system( executable1 );
system( executable2 );

But the Command windows hangs until I kill the process from task
manager.
The second line never gets executed.
Also the script must not skip directly to the second line because each
executable needs the previous one to start up.
Is there another command in Perl than system()?
Many thanks

try geting the result,
@result=`executable1`
 
A

A. Sinan Unur

try geting the result,
@result=`executable1`

Why should the OP try that? What have you diagnosed the problem as and why
would using backticks solve that problem? Besides, the only line of code
you posted containts a syntax error (unless it is the only statement in the
program).

Sinan.
 
C

Chris Mattern

Jean-Benoit MORLA said:
Hi,

I have to run 4 Windows XP Pro executables sequentially from a script.
Each executable has to be started after its predecessor.
I tried:

system( executable1 );
system( executable2 );

But the Command windows hangs until I kill the process from task
manager.

Then your first executable is not terminating.
The second line never gets executed.
Also the script must not skip directly to the second line because each
executable needs the previous one to start up.
Is there another command in Perl than system()?
Many thanks

I'd be looking at executable1, myself. The only reason the system()
subroutine would not return is because executable1 is not terminating.

--
Christopher Mattern

"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,607
Members
45,240
Latest member
pashute

Latest Threads

Top