Now it emails me instead of failing to write to a file

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@2121 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2003-07-30 14:42:55 +00:00
parent 87c36672ce
commit c3985b574a

View File

@ -100,12 +100,21 @@ sub loadProjectList() {
} }
sub addProject() { sub addProject() {
my ($project) = @_; my ($project) = @_;
my $cmd = "echo \"@{[$project->getString()]}\" > @{[$project->getJobsFile()]}"; #my $cmd = "echo \"@{[$project->getString()]}\" > @{[$project->getJobsFile()]}";
eval { #my $cmd = "mail tomcopeland@users.sourceforge.net -s \"@{[$project->getString()]}\"";
# for some reason this succeeds, but the CGI script fails. Very odd. #system("${cmd}");
`${cmd}`; open(SENDMAIL, "|/usr/lib/sendmail -oi -t -odq") or die "Couldn't send email: $!\n";
} print SENDMAIL <<"EOF";
From: PMD-WEB <tomcopeland\@users.sourceforge.net>
To: Tom Copeland <tomcopeland\@users.sourceforge.net>
Subject: @{[$project->getString()]}
enter it
EOF
close(SENDMAIL) or warn "Sendmail didn't close nicely";
} }
$page=param("state") || "default"; $page=param("state") || "default";