open PRG,"/some/prog|" or die "Cannot fork prog"; while () { # do something with the line in $_ } close PRG;