Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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?


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1069435]
[jdporter]: erix - excellent. thanks! davido - no; just reminiscing. :-)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2018-06-21 16:58 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (118 votes). Check out past polls.