my $cmd = 'mail -s "Test" testmail@server.com, < DailyReport_$d.txt'; print "Running [$cmd]\n"; system($cmd) == 0 or warn "Couldn't run [$cmd]: $! / $?";