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

Bretheren and Cistern,

I have been charged with rewriting a batch file. I discerned that this batch file would serve better as a perl script. I have been trying to get around system("program to call") on Win32.

Can anyone enlighten me on converting these two lines to something more "perl controllable"? In other words, I need to be able to monitor the processes so that if errors occur, I can log them, e-mail them, try again...etc
system("pgp.exe $DECRYPT_WORK_PATH$ENCRYPTED_FILENAME -o $DECRYPT_WORK_PATH$PLAINTEXT_FILENAME"); and system("somescript.pl $DECRYPT_WORK_PATH$PLAINTEXT_FILENAME")

I have tried using WIN32::Process::Create with no luck. I don't want to use WIN32::Console because there is already enough garbage on the screen.

Thanks in advance,
fmogavero

Replies are listed 'Best First'.
Re: running perl scripts from other perl scripts.
by arturo (Vicar) on Sep 14, 2001 at 00:34 UTC

      If the original poster wants to include Win9x in their definition of Win32, then the methods you link to won't work for them.

      The most portable way I know to do this is:

      use IPC::Open3; my $pid= open3( "<&STDIN", *OUT, *OUT, "command" ); my @errors= <OUT>; close OUT; my $status= waitpid $pid, 0;

              - tye (but my friends call me "Tye")
Re: running perl scripts from other perl scripts.
by derby (Abbot) on Sep 14, 2001 at 02:01 UTC