{
    "mode": "perldoc",
    "parameter": "POE::Filter::Line",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/POE%3A%3AFilter%3A%3ALine/json",
    "generated": "2026-06-13T00:25:01Z",
    "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;",
    "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": []
        }
    },
    "summary": "POE::Filter::Line - serialize and parse terminated records (lines)",
    "flags": [],
    "examples": [],
    "see_also": []
}