{
    "content": [
        {
            "type": "text",
            "text": "# POE::Filter::Line (perldoc)\n\n## NAME\n\nPOE::Filter::Line - serialize and parse terminated records (lines)\n\n## SYNOPSIS\n\n#!perl\nuse POE qw(Wheel::FollowTail Filter::Line);\nPOE::Session->create(\ninlinestates => {\nstart => sub {\n$[HEAP]{tailor} = POE::Wheel::FollowTail->new(\nFilename => \"/var/log/system.log\",\nInputEvent => \"gotlogline\",\nFilter => POE::Filter::Line->new(),\n);\n},\ngotlogline => sub {\nprint \"Log: $[ARG0]\\n\";\n}\n}\n);\nPOE::Kernel->run();\nexit;\n\n## DESCRIPTION\n\nPOE::Filter::Line parses stream data into terminated records. The default parser interprets\nnewlines as the record terminator, and the default serializer appends network newlines (CR/LF,\nor \"\\x0D\\x0A\") to outbound records.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **PUBLIC FILTER METHODS**\n- **SUBCLASSING**\n- **SEE ALSO**\n- **BUGS**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "POE::Filter::Line",
        "section": "",
        "mode": "perldoc",
        "summary": "POE::Filter::Line - serialize and parse terminated records (lines)",
        "synopsis": "#!perl\nuse POE qw(Wheel::FollowTail Filter::Line);\nPOE::Session->create(\ninlinestates => {\nstart => sub {\n$[HEAP]{tailor} = POE::Wheel::FollowTail->new(\nFilename => \"/var/log/system.log\",\nInputEvent => \"gotlogline\",\nFilter => POE::Filter::Line->new(),\n);\n},\ngotlogline => sub {\nprint \"Log: $[ARG0]\\n\";\n}\n}\n);\nPOE::Kernel->run();\nexit;",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 22,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "PUBLIC FILTER METHODS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SUBCLASSING",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 23,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "POE::Filter::Line - serialize and parse terminated records (lines)\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "#!perl\n\nuse POE qw(Wheel::FollowTail Filter::Line);\n\nPOE::Session->create(\ninlinestates => {\nstart => sub {\n$[HEAP]{tailor} = POE::Wheel::FollowTail->new(\nFilename => \"/var/log/system.log\",\nInputEvent => \"gotlogline\",\nFilter => POE::Filter::Line->new(),\n);\n},\ngotlogline => sub {\nprint \"Log: $[ARG0]\\n\";\n}\n}\n);\n\nPOE::Kernel->run();\nexit;\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "POE::Filter::Line parses stream data into terminated records. The default parser interprets\nnewlines as the record terminator, and the default serializer appends network newlines (CR/LF,\nor \"\\x0D\\x0A\") to outbound records.\n\nRecord terminators are removed from the data POE::Filter::Line returns.\n\nPOE::Filter::Line supports a number of other ways to parse lines. Constructor parameters may\nspecify literal newlines, regular expressions, or that the filter should detect newlines on its\nown.\n",
                "subsections": []
            },
            "PUBLIC FILTER METHODS": {
                "content": "POE::Filter::Line has no additional public methods.\n",
                "subsections": []
            },
            "SUBCLASSING": {
                "content": "POE::Filter::Line exports the FIRSTUNUSED constant. This points to the first unused element in\nthe $self array reference. Subclasses should store their own data beginning here, and they\nshould export their own FIRSTUNUSED constants to help future subclassers.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Please see POE::Filter for documentation regarding the base interface.\n\nThe SEE ALSO section in POE contains a table of contents covering the entire POE distribution.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "The default input newline parser is a regexp that has an unfortunate race condition. First the\nregular expression:\n\n/(\\x0D\\x0A?|\\x0A\\x0D?)/\n\nWhile it quickly recognizes most forms of newline, it can sometimes detect an extra blank line.\nThis happens when a two-byte newline character is broken between two reads. Consider this\nsituation:\n\nsome stream dataCR\nLFother stream data\n\nThe regular expression will see the first CR without its corresponding LF. The filter will\nproperly return \"some stream data\" as a line. When the next packet arrives, the leading \"LF\"\nwill be treated as the terminator for a 0-byte line. The filter will faithfully return this\nempty line.\n\nIt is advised to specify literal newlines or use the autodetect feature in applications where\nblank lines are significant.\n\nAUTHORS & COPYRIGHTS\nPlease see POE for more information about authors and contributors.\n",
                "subsections": []
            }
        }
    }
}