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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^14: expect.pm header
by amagana (Acolyte) on Apr 08, 2015 at 19:54 UTC | |
by sn1987a (Deacon) on Apr 08, 2015 at 20:18 UTC | |
by amagana (Acolyte) on Apr 08, 2015 at 21:12 UTC | |
by sn1987a (Deacon) on Apr 08, 2015 at 21:20 UTC | |
by amagana (Acolyte) on Apr 08, 2015 at 21:42 UTC | |
|
In Section
Seekers of Perl Wisdom