Oops, forgot message headers.

perl -e 'use Date::Calc qw(:all);

  $MONDAY = 1;
  $NUM_DAYS_BTWN_MON_WED = 5;

  ($tyear,$tmonth,$tday) = Today();

  # $mday et al. identify the 2nd Monday in the given month
  die "Nth_Weekday_of_Month_Year problem!\n"
    if (! (($myear,$mmonth,$mday) 
            = Nth_Weekday_of_Month_Year($tyear,$tmonth,$MONDAY,2)));

  $dd = Delta_Days($tyear,$tmonth,$tday,
                   $myear,$mmonth,$mday);
  
  if ($dd == $NUM_DAYS_BTWN_MON_WED) {

     open(MAIL, "| /usr/lib/sendmail -oi -oem -t") 
       || die "Couldn't open sendmail: $!\n";
     $SIG{PIPE} = 'IGNORE';  # good idea
     print MAIL <<EO_MESSAGE;
To: GNHLUG <[email protected]>
From: [EMAIL PROTECTED]
Subject: upcoming SLUG meeting on $mmonth/$mday/$myear

Hello,

You might be fascinated to learn that there is a SLUG meeting next Monday
evening at 7pm.  As a reminder, SLUG meetings occur on the second Monday
of each month.  Today is Wednesday; I just wanted to give you plenty of
advance notice.

Kind regards,

The SLUG Daemon

EO_MESSAGE

  } # end of "if ($dd == $NUM_DAYS_BTWN_MON_WED) {"
'
__END__


Hope this is useful,

--kevin
-- 
GnuPG ID: B280F24E                     And the madness of the crowd
alumni.unh.edu!kdc                     Is an epileptic fit
                                       -- Tom Waits
_______________________________________________
gnhlug-org mailing list
[email protected]
http://mail.gnhlug.org/mailman/listinfo/gnhlug-org

Reply via email to