use IO::File; my $f = new IO::File; $f->open("program 2>&1 1>NULL |") or die "Can not open stderr from another process."; while (<$f>) { ... do stuff }