open(PIPE, "command |") or die $!; while() { # ... do something }