for (@cmdout) { my $bytes = print $_; print STDERR "bytes: $bytes, err: $!\n"; }