Perl and waiting for execution of external program
jonas.andersson_at_rocketmail.com
Date: 01/19/05
- Next message: Jim Keenan: "Re: Perl6 book"
- Previous message: Leonard Challis: "Re: The world's shortest 'Hello World!' program: a proposal"
- Next in thread: Gunnar Hjalmarsson: "Re: Perl and waiting for execution of external program"
- Reply: Gunnar Hjalmarsson: "Re: Perl and waiting for execution of external program"
- Reply: Chris Mattern: "Re: Perl and waiting for execution of external program"
- Reply: xhoster_at_gmail.com: "Re: Perl and waiting for execution of external program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 19 Jan 2005 07:14:38 -0800
Hi,
Sometimes, when running an external program through Perl, I run into
problems:
...
open (PROG, "|$MyProgram &> /dev/null") or die "cannot open
program"
print PROG "Load file $FileName\n";
print PROG "Calculate all\n";
close (PROG) or die "cannot close program";
...
It sometimes happens that Perl does not wait for the (lengthy)
calculations to finish, but tries to close the program prematurely. (At
least, that is what the symptoms look like).
Is there a way to force Perl to wait for the program to finish before
it tries to close it, however long it takes?
Thanks for your time,
JA
- Next message: Jim Keenan: "Re: Perl6 book"
- Previous message: Leonard Challis: "Re: The world's shortest 'Hello World!' program: a proposal"
- Next in thread: Gunnar Hjalmarsson: "Re: Perl and waiting for execution of external program"
- Reply: Gunnar Hjalmarsson: "Re: Perl and waiting for execution of external program"
- Reply: Chris Mattern: "Re: Perl and waiting for execution of external program"
- Reply: xhoster_at_gmail.com: "Re: Perl and waiting for execution of external program"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|