use strict; use warnings; use IPC::Open3 qw( open3 ); my $make_file = 'Makefile'; open(local *TO_MAKE, '<&', *STDIN) or die; *TO_MAKE if 0; # Avoid spurious warning. my $make_pid = open3( '<&TO_MAKE', local *FR_MAKE, undef, 'make', '-f', $make_file, ); *FR_MAKE if 0; # Avoid spurious warning. my $tee_pid = open3( '<&FR_MAKE', '>&STDOUT', undef, 'tee', '-a', 'build.log', ); waitpid($make_pid, 0); print("$?\n"); waitpid($tee_pid, 0); print("$?\n");