in reply to Advise on current Mail script

I've been a fan of MIME::Lite and functional ternary expressions for awhile, so here's my take on it (untested, but I usually get these right on the first shot):
use strict; use MIME::Lite; my $old = 'Foo'; my $curr = 'Foo'; my $from = 'from@there.com'; my $to = 'mail@there.com'; my $subject = 'Subject C message here'; # You could nest one more ternary in here for # '$var eq $job' $old ne $curr ? $subject = 'Subject A message here' : $subject = 'Subject B message here'; my $msg = MIME::Lite->new( From => $from, To => $to, Subject => $subject, Data => "Here's the message body you wanted", Type => 'text/plain' ); # You'd want $msg->send; though, of course print $msg->as_string;