hi
I try to read a simply text file and send contents by mail
I have a perl script, but it doesn't work:
open(FILE, "/var/log/log.txt");
$content=<FILE>;
close(FILE);
open(MAIL, "|/usr/sbin/sendmail -t");
print MAIL "to:adress\@mydomain.xx\n";
print MAIL "from:server\@mydomain.xxt\n";
print MAIL "subject:log file !\n";
print MAIL "$content\n\n";
close(MAIL);
I get error mesage for 2 lines:
$content=<FILE>;
" Global symbol "$content" requires explicit package name "
and
print MAIL "$content\n\n";
" Global symbol "$content" requires explicit package name "
kind regards
ccc
I try to read a simply text file and send contents by mail
I have a perl script, but it doesn't work:
open(FILE, "/var/log/log.txt");
$content=<FILE>;
close(FILE);
open(MAIL, "|/usr/sbin/sendmail -t");
print MAIL "to:adress\@mydomain.xx\n";
print MAIL "from:server\@mydomain.xxt\n";
print MAIL "subject:log file !\n";
print MAIL "$content\n\n";
close(MAIL);
I get error mesage for 2 lines:
$content=<FILE>;
" Global symbol "$content" requires explicit package name "
and
print MAIL "$content\n\n";
" Global symbol "$content" requires explicit package name "
kind regards
ccc