use strict; use warnings; my $MAKECOMMAND='make'; my $target='test'; system("$MAKECOMMAND | tee -a ./prepare_$target.log");