File::LocalizeNewlines(3pm) User Contributed Perl Documentation File::LocalizeNewlines(3pm)
NAME
File::LocalizeNewlines - Localize the newlines for one or more files
DESCRIPTION
For people that routinely work with a mixture of different platforms that have conflicting newline formats (mainly *NIX and Win32) there
are a number of different situations that can result in files having their newlines get corrupted.
File::LocalizeNewlines provides a mechanism for one off or bulk detection and conversion of these files to the newline style for the local
platform.
The module implements the conversion using a standard "universal line seperator" regex, which ensures that files with any of the different
newlines, plus a couple of common "broken" newlines, including multiple different types mixed in the same file, are all converted to the
local platform's newline style.
METHODS
new param => value, ...
The "new" constructor creates a new conversion object.
By default, the conversion object will process all files and convert them to the local platform's newline format.
Takes some optional parameters
filter => File::Find::Rule
The "filter" param allows you to provide an instantiate File::Find::Rule object, that will used to determine the list of files to check
or process.
newline => $newline
The "newline" option allows you to provide an alternative newline format to the local one. The newline format should be provided as a
literal string.
For example, to force Win32 newlines, you would use
my $Object = File::LocalizeNewlines->new( newline => "