Make Perl script send email when condition occurs

Discussion in 'Programming' started by steve1040, Feb 5, 2015.

  1. #1
    Can some help me with the following issue

    I'd like to add a email notification when modified date is old.
    My system admin told me to use Mailx (mailx -s "Subject" )

    Here are the two lines that check the 2 variables in question. Can someone show me how to write Perl code so that each check sends a email

    ##My Code Start######

    # If lacecurrent is not equal to today then do not run
    die if ( -M $currentlist_file > 1);
    die if ( -M $pre_historical_file > 2);

    ###My Code Stop#######

    Thanks
    Steve
     
    steve1040, Feb 5, 2015 IP