tmtech1 has asked for the wisdom of the Perl Monks concerning the following question:
$hostname = `hostname`; use Net::SMTP; @Output = ""; @OutputDetails = ""; $Log_File = "E:\\Backups\\LOGs\\Sync_Import.log"; open (STDOUT,">>$Log_File"); open (Output,"multiutil <cmd>|"); while(<Output>) { $TheLine = $_; chomp($TheLine); #Get rid of line break push (@OutputDetails, $TheLine); } Mail_Body; Mail_Msg; sub Mail_Body{ $body0 = "This message sent by the Import Process"; $body1 = "\n $TheLine\n"; <==== REPLACE w/@OutputDetails } sub Mail_Msg{ $smtp = Net::SMTP->new( "mail.company.com" ); $smtp->mail( "ALIAS\@company.com" )"; $smtp->to('ALIAS\@company.com'); $smtp->data(); $smtp->datasend("Subject:Job Failure\n"); $smtp->datasend(<<EOF_MAIL $body0 $body1 <==== THIS SHOULD BE EVERY LINE IN @OutputDetails EOF_MAIL ); $smtp->datasend(); $smtp->quit(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Printing an array in a Here Doc
by Fletch (Bishop) on Jun 27, 2006 at 20:09 UTC | |
by tmtech1 (Initiate) on Jun 27, 2006 at 20:29 UTC | |
by shmem (Chancellor) on Jun 27, 2006 at 22:31 UTC | |
|
Re: Printing an array in a Here Doc
by esskar (Deacon) on Jun 27, 2006 at 20:28 UTC | |
by tmtech1 (Initiate) on Jun 27, 2006 at 20:52 UTC | |
|
Re: Printing an array in a Here Doc
by jdtoronto (Prior) on Jun 27, 2006 at 20:16 UTC | |
|
Re: Printing an array in a Here Doc
by jwkrahn (Abbot) on Jun 27, 2006 at 22:34 UTC |