The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The problem is that you are transferring a text file between systems that differ in how they represent an end of line character. This is precisely the reason why a program such as FTP implement the bin and ascii mode functions.
When you transfer a file in binary mode, it remains unchanged (this mode is typically used to transfer compiled programs / BINaries). When dealing with end of line characters in text files that roboticus elaborated on, ascii mode would have to be used to do a transformation of the end of line character to make it appropriate to the target platform. In perl, you would need to use a s/\r\n/\n/; to do the equivalent transform when doing a Windows -> UNIX transfer. The reason for this madness lies in how early computer systems had to interact with teletype and typewriter devices that were unable to advance the print head to the next line in single character time (see Newline). In reply to Re: Convert binary to ascii while sftp using Net::SSH2
by 0xbeef
|
|