Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Use Mailx with Perl

by soonix (Canon)
on Feb 07, 2015 at 19:41 UTC ( [id://1115873]=note: print w/replies, xml ) Need Help??


in reply to Use Mailx with Perl

I'd do something like the following (untested)
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; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1115873]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-26 03:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found