in reply to IPC::Open3 confusion

It has to do with flushing the output buffers, which happens automatically when you write to the console but not to your special handles.

Try adding this at the top of your outerr.pl:

use IO::Handle; STDOUT->autoflush(1); STDERR->autoflush(1);
Update:Also, IPC::Run is reputed to be safer to use than IPC::Open3. Here is how it would look:
use strict; use IPC::Run qw(run); my @com = qw(outerr.pl); my ($in, $out); run( \@com, \$in, \$out, \$out); print $out;
(Sad to say though, neither this version nor the one by BazB seems to give the interleaved output you want, even with autoflush turned on, on my Linux box. All the STDOUTs come before all the STDERRs).