.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "HTTP::Proxy::BodyFilter::lines 3pm" .TH HTTP::Proxy::BodyFilter::lines 3pm "2022-12-04" "perl v5.36.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" HTTP::Proxy::BodyFilter::lines \- A filter that outputs only complete lines .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 2 \& use HTTP::Proxy::BodyFilter::lines; \& use MyFilter; # this filter only works on complete lines \& \& my $filter = MyFilter\->new(); \& \& # stack both filters so that they\*(Aqll handle text/* responses \& $proxy\->push_filter( \& mime => \*(Aqtext/*\*(Aq, \& response => HTTP::Proxy::BodyFilter::lines\->new, \& response => $filter \& ); \& \& # I want my lines to end with \*(Aq!\*(Aq \& # This is equivalent to $/ = \*(Aq!\*(Aq in a normal Perl program \& my $lines = HTTP::Proxy::BodyFilter::lines\->new(\*(Aq!\*(Aq); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" The HTTP::Proxy::BodyFilter::lines filter makes sure that the next filter in the filter chain will only receive complete lines. The \*(L"chunks\*(R" of data received by the following filters with either end with \f(CW\*(C`\en\*(C'\fR or will be the last piece of data for the current \s-1HTTP\s0 message body. .PP You can change the idea the filter has of what is a line by passing to its constructor the string it should understand as line ending. \f(CW\*(C`\en\*(C'\fR is the default value. .PP .Vb 1 \& my $filter = HTTP::Proxy::BodyFilter::lines\->new( $sep ); .Ve .PP This is similar to modifying \f(CW$/\fR in a Perl program. In fact, this filter has a behaviour so similar to modifying $/ that it also knows about \*(L"paragraph mode\*(R" and \*(L"record mode\*(R". .PP Note that the \*(L"slurp\*(R" mode is not supported. Please use HTTP::Proxy::BodyFilter::complete to enable the generic store and forward filter mechanism. .SH "METHODS" .IX Header "METHODS" This filter defines the following methods, which are automatically called: .IP "\fBinit()\fR" 4 .IX Item "init()" Initialise the filter with the \s-1EOL\s0 information. .IP "\fBfilter()\fR" 4 .IX Item "filter()" Keeps unfinished lines for later. .IP "\fBwill_modify()\fR" 4 .IX Item "will_modify()" This method returns a \fIfalse\fR value, thus indicating to the system that it will not modify data passing through. .SH "SEE ALSO" .IX Header "SEE ALSO" HTTP::Proxy, HTTP::Proxy::BodyFilter. .SH "AUTHOR" .IX Header "AUTHOR" Philippe \*(L"BooK\*(R" Bruhat, . .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2003\-2015, Philippe Bruhat. .SH "LICENSE" .IX Header "LICENSE" This module is free software; you can redistribute it or modify it under the same terms as Perl itself.