open TEMP,"cleartool checkout -nc $element_pathname 2>&1 |" or die "Failed to checkout: $!"; # Read from TEMP as usual, but now we also have STDERR #### use IPC::Open3; my $pid = open3 IGNORE,TEMPOUT,TEMPERR, 'cleartool',"checkout -nc $element_pathname" or die "Failed to open3: $!"; # first read from TEMPERR while () { # open3 returns an exec error on the error fh you gave it /^open3:/ && die "Error in open3: $_"; # Check for the cleartool error message here } while () { print "The message is - $_"; } # Don't forget to reap it! waitpid $pid,0;