open (CMD, "(time $commandline | sed 's/^/STDOUT:/') 2>&1 |"); while () { if (s/^STDOUT://) { push @stdout, $_; } else { push @stderr, $_; } }