I'm a perl newbie and need help with writing a script to do the
following:
1) Open a file that is delimited. The file is in this format:
<name>;<email address1>;<user1>;<user2>;....<userX>;
The delimiters can be changed. This is a manually created file.
Email and user may be more than one item.
2) Send an email to <email address> using the file from #1. The
email should be like
To <name>
Please verify that the following users are still under your
supervision by <date>:
<user1>
<user2>
<userX>
Thank you.
3) For calculating the date, I've used the below and added 14 days
(1209600 seconds):
@Weekdays = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
'Friday', 'Saturday');
@Months = ('January', 'February', 'March', 'April', 'May', 'June',
'July', 'August', 'September', 'October', 'November', 'December');
@Now = localtime(time + 1209600); # adding the number of seconds in a
day (86400) and multiplying for 14 days
$Month = $Months[$Now[4]];
$Weekday = $Weekdays[$Now[6]];
$Hour = $Now[2];
if ($Hour > 12) {
$Hour = $Hour - 12;
$AMPM = "PM";
} else {
$Hour = 12 if $Hour == 0;
$AMPM ="AM";
}
$Minute = $Now[1];
$Minute = "0$Minute" if $Minute < 10;
$Year = $Now[5]+1900;
$Expire = "$Weekday, $Month $Now[3], $Year";
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/