1eol(3)                User Contributed Perl Documentation               eol(3)
2
3
4

NAME

6       PerlIO::eol - PerlIO layer for normalizing line endings
7

VERSION

9       This document describes version 0.14 of PerlIO::eol, released December
10       18, 2006.
11

SYNOPSIS

13           binmode STDIN, ":raw:eol(LF)";
14           binmode STDOUT, ":raw:eol(CRLF)";
15           open FH, "+<:raw:eol(LF-Native)", "file";
16
17           binmode STDOUT, ":raw:eol(CRLF?)"; # warns on mixed newlines
18           binmode STDOUT, ":raw:eol(CRLF!)"; # dies on mixed newlines
19
20           use PerlIO::eol qw( eol_is_mixed );
21           my $pos = eol_is_mixed( "mixed\nstring\r" );
22

DESCRIPTION

24       This layer normalizes any of "CR", "LF", "CRLF" and "Native" into the
25       designated line ending.  It works for both input and output handles.
26
27       If you specify two different line endings joined by a "-", it will use
28       the first one for reading and the second one for writing.  For example,
29       the "LF-CRLF" encoding means that all input should be normalized to
30       "LF", and all output should be normalized to "CRLF".
31
32       By default, data with mixed newlines are normalized silently.  Append a
33       "!"  to the line ending will raise a fatal exception when mixed
34       newlines are spotted.  Append a "?" will raise a warning instead.
35
36       It is advised to pop any potential ":crlf" or encoding layers before
37       this layer; this is usually done using a ":raw" prefix.
38
39       This module also optionally exports a "eol_is_mixed" function; it takes
40       a string and returns the position of the first inconsistent line ending
41       found in that string, or 0 if the line endings are consistent.
42
43       The "CR", "LF", "CRLF" and "NATIVE" constants are also exported at
44       request.
45

AUTHORS

47       Audrey Tang <autrijus@autrijus.org>.
48
49       Janitorial help by Gaal Yahas <gaal@forum2.org>.
50
51       Inspired by PerlIO::nline by Ben Morrow, <PerlIO-eol@morrow.me.uk>.
52
54       Copyright 2004-2006 by Audrey Tang <audreyt@audreyt.org>.
55
56       This program is free software; you can redistribute it and/or modify it
57       under the same terms as Perl itself.
58
59       See <http://www.perl.com/perl/misc/Artistic.html>
60
61
62
63perl v5.12.0                      2006-12-16                            eol(3)
Impressum