It looks like you are missing the leading quotation mark
in your system call. Running perl -wc on your code will
help you find small errors like this.
Update: I ran perl -wc on this code and it didn't
spit out any errors, so it wouldn't have helped you in this
case. It's still a good idea to use it though :)
I would try and shy away from writing the mail to a temp
file though; it will be a headache for you if the directory
or file permissions ever get changed. I would probably do
something like:
open (MAIL, "|/usr/sbin/sendmail -t -oi -em")
|| die "Couldn't open sendmail: $!";
print MAIL <<EOM;
To: me\@mycompany.com
From: myscript\@mycompany.com
Subject: Some subject
$reportdata
EOM
close (MAIL);
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.