use strict; use warnings; use FileHandle; my $handle = FileHandle->new("/path/to/process |"); $handle->autoflush(1); while(my $line = <$handle>) { print $line; # do something useful with $line... }