redlake2 has asked for the wisdom of the Perl Monks concerning the following question:


I need some help. I need to check if a process is running and then continue on with some Perl code after the process completes. (I am going to use notepad.exe as an example app)

The Perl call prglst doesn't work for me so I wrote some DOS code that works sending the data through to a file that I can read:

set tempfile = "C:\Testing\TestNotepadRunning.txt"
tasklist > %tempfile%

Then transposing that call into Perl won't work for me:

my @tempfile = 'C:\Testing\TestNotepadRunning.txt'; system('TASKLIST > $tempfile');

Can you help?