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 () { # your code here... } close(NET) or die "can't close netstat: $!/$?";