#!/usr/bin/perl
pipe(IN,OUT);   # pipe() requires 3.0 patchlevel 9
open(STDERR,">&OUT");  # hook stderr to the write side of the pipe
close OUT;   # this filehandle not needed now
fork || (close IN, exec @ARGV); # run command as a child
close STDERR;   # make sure only child has write side open.
@cache = <IN>;   # gets EOF when child dies
wait;    # harvest status
print "*** HERE ARE THE ERRORS ***\n", @cache, "*** EXIT STATUS WAS $? ***\n";
