in reply to Re^12: expect.pm header
in thread expect.pm header
Thank you for the output. That makes things much clearer.
I suspect the ^M were always there, but since all of the lines had them, vi assumed DOS line endings and suppressed them. But, once you added the header with only the line feed, it thought it had unix line endings and showed all of the ^M's. If I am correct, the solution is to replace \n in the header with \r\n like this
my $header = "\r\n\r\n======= system =======\r\n";
To get the word "system" change to the actual system name in the log file, replace the line
with$ssh->print_log_file($header);
my $my_header = $header; $my_header =~ s/system/$system/; $ssh->print_log_file($my_header);
I hope this helps. Let me know what happens.
In Section
Seekers of Perl Wisdom