in reply to Re: launching external program with SYSTEM causes script to hang until program closed
in thread launching external program with SYSTEM causes script to hang until program closed
Please note that when you explictly close the piped filehandle, it will cause the parent process to wait for the child to finish (and I recommend closing it).open(NET, "netstat -i -n |") or die "can't fork: $!"; # You could go off and do other things here for a bit, # and then come back to check on your results. while (<NET>) { # your code here... } close(NET) or die "can't close netstat: $!/$?";
|
|---|