http://qs1969.pair.com?node_id=258705

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

At work here we are converting a tcl script into a perl script. One of the interesting lines of the tcl script is the following:
set f_handle [open {|./script.pl >& script.log} a] -----Some deleted code-------- if [catch {close $f_handle} ] { send_mail "Script had a problem, returned non-zero status!." } else { send_mail "Script ok." }
What this code does is open a process and run "./script.pl >& script.log" alongside of the tcl script. Then later, the "catch" function waits for the script to finish (if it hasn't) and grabs the exit value of "script.pl". Is there a way to do a similar thing in perl? Remember that the "script.pl" actually runs in parallel with the tcl script.