Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Alias (5735)

  (email not shown publicly)

Journal of Alias (5735)

Sunday May 07, 2006
06:56 AM

localizenewlines - A tool to fix newlines robustly

[ #29549 ]

A bad day for Yak Shaving today.

A POD patch to Test::Inline meant moving it over from CVS to the new repository, during which I discovered that I've (again) systematically screwed up the newlines in a couple of the modules I've moved over.

Because I write on Windows for Linux, I've encountered just about every newline edge condition you can possibly imagine, often on a daily basis.

So in frustration, I've also moved in File::LocalizeNewlines and finally got around to writing a front-end script.

localizenewlines (excuse the longish name, but I'm avoiding collisions and you should have tab completion anyway) will just DWYM and "fix" newlines, on any platform.

It translates in from local, Win32, Mac, Unix, mixed newlines, and even the crazy \015\015\012 that only happens when Mac and Win32 get close to each other.

It doesn't touch binary files, and only changes files it has write permissions for.

The --svn/-s flag also makes it ignore .svn dirs.

So if you ever ask "how do I convert my newlines from ..." localizenewlines is now available as an answer to all of those questions.

And it works on any platform. Enjoy.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.