On Jan 14, 2010, at 12:43 AM, Jim Gibson wrote: > On 1/13/10 Wed Jan 13, 2010 3:28 PM, "ANJAN PURKAYASTHA" > <anjan.purkayas...@gmail.com> scribbled: > >> Hi, >> Suppose I run an application from within a perl script, with system (eg >> system ("myfavprogram input_file out_file")). >> Is there a way to let the script know that the program has finished running >> and that I can move on to the next step in the perl script? > > The system function will wait for the external process to terminate before > continuing. See 'perldoc -f system'. So unless your external process does > something funny, like starting its own processes and returning early to its > caller before finishing, you shouldn't have to do anything special in your > Perl program.
The 'system' command is often considered hard to interpret - its output can be cryptic. There are tools on the CPAN to help with using 'system', things like IPC::Run and IPC::System::Simple. Perhaps after you looked at the code synopses there you might find something that does what you want. Jeremiah