in reply to Use Mailx with Perl
my @msg; push @msg, "$currentlist_file too old" if ( -M $currentlist_file > 1); push @msg, "$pre_historical_file too old" if ( -M $pre_historical_file + > 2); if (@msg) { open(my $mail, '|-', "/usr/bin/mailx ...") or die "failed opening +pipe to mailx"; # salutation and valediction :-) unshift @msg, 'Dear Steve,', ''; push @msg, '', 'I beg to remain, Sir, your most humble and obedien +t servant,', "\t$0"; print $mail, join ("\n", @msg); close $mail; }
|
|---|