I am running into an issue where a new line will not always print after certain statements. It appears to be an issue with certain variables that are presented in these print statements. The strange thing is if I take the program through debug and view the array it shows that each statement is on a new line. The log prints correctly, but the email does not. Code:
then I will present them in a single variable and email them:$message = "A difference in /opt/local/bin has been noted: $opt_local_ +bin{$file}{'new'}{'file'} is now available\n"; push @messages, $message;
The result I get from this is, where *NEWLINE* is the next difference the program finds:$message = join('',@messages); $subject = "CM Audit Daily Changes Notification"; &mail_admin($subject,$message);
If I join with a new line ($message = join('\n',@messages);) I get:
A difference in /opt/local/bin has been noted: clean_oratab is no longer available
A change in /etc/hosts has been detected. 10.40.250.3 r2dmn1 # regatta 2 domain 1 switch is no longer available
But I do not want the whitespace between the lines.
If I use ‘’ between the variable and end of the line it works, but it prints the ‘’:
gives the following result:$message = "A difference in /opt/local/bin has been noted: ‘$opt_local +_bin{$file}{'new'}{'file'} is now available’\n"; push @messages, $message;
A difference in /opt/local/bin has been noted: ‘clean_oratab is no longer available’
A change in /etc/hosts has been detected. 10.40.250.3 r2dmn1 # regatta 2 domain 1 switch is no longer available
Obviously it is something in the variable output on certain lines. But again it only affects the emailed results, not anything I can see in debug or the log files which is an exact copy of what is sent to the email program.
Any ideas before I give up?
In reply to New Lines are not printing after certain messages by tbest4475
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |