Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: String wraps after a replace operation

by Jim (Curate)
on Jan 06, 2014 at 00:30 UTC ( #1069435=note: print w/ replies, xml ) Need Help??


in reply to Re^2: String wraps after a replace operation
in thread String wraps after a replace operation

This is a classic:  CR-LF versus LF newline differences in text files between operating systems (DOS/Windows versus Unix/Linux/OS X).

What text editor did you use to save the file using those formats and character encoding names? I ask this because those names are bogus and confusing, especially the character encoding names. There's no such thing as an encoding named "DOS", and the name "ANSI" is an historic misnomer that is more properly "Windows-1252" or "Code Page 1252" or "CP1252". I suspect the encoding name "DOS" is intended to mean "Code Page 437" or "CP437". But who knows?

You may need to use a better text editor.

Unless you're doing something extraordinary to thwart its default behavior (setting the mode of the I/O layer to :raw, for example), Perl should just be doing the right thing with the line terminators in your file. In other words, in general, Perl handles both CR-LF and LF logical newlines correctly and transparently. What version and distro of Perl are you using? ActiveState Perl? Strawberry Perl? Or the Perl that comes with Cygwin?

Jim


Comment on Re^3: String wraps after a replace operation
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1069435]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (19)
As of 2014-07-11 17:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (232 votes), past polls