Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: String wraps after a replace operation

by aceroraptor (Initiate)
on Jan 05, 2014 at 18:31 UTC ( #1069402=note: print w/replies, xml ) Need Help??

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

My development environment is on cygwin, the issue was
due to my test text file containing sample data was
saved in a file Format = PC and encoding = DOS, once I
changed it to Format = UNIX and encoding = ANSI my code worked.

  • Comment on Re^2: String wraps after a replace operation

Replies are listed 'Best First'.
Re^3: String wraps after a replace operation
by Jim (Curate) on Jan 06, 2014 at 00:30 UTC

    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://1069402]
[Corion]: 1nickt: Finding autobox in production would give me pause, yes
[LanX]: efficient survey
[MidLifeXis]: And under MINGW64_NT-6.1 MYHOST 2.6.0(0.304/5/3) 2016-09-09 09:46 x86_64 Msys there seem to be issues with escapes in external build tool calls.
[Corion]: I mean, it's a technical feat it achieves, but... why? ;)
[MidLifeXis]: And it also has the 0.14 version of the tarball in its manifest.
[LanX]: avoiding unreadable brackets
[MidLifeXis]: Although the previous one could be a b0rken PATH, I would need to dig for that.
[thezip]: I've got to go to meetings now. If anyone has further comments regarding Spreadsheet::XLSX deployment to Strawberry Perl 5.24.1, please /msg me -- thanks!
LanX has to go ... plans to crash with a car into a group of pythonistas while screaming "LARRY IS THE GREATEST"
LanX ... darn ... where is my car?

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (13)
As of 2017-03-23 17:26 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (291 votes). Check out past polls.