#!/usr/bin/perl use warnings; use strict; open (IN, '-|', 'perl PrintStdoutStdErr.pl') or die "$!"; while () { print; } __END__ prints: this went to STDERR this went to STDOUT