1HTTP::Proxy::BodyFilterU:s:elrinCeosn(t3r)ibuted Perl DoHcTuTmPe:n:tPartoixoyn::BodyFilter::lines(3)
2
3
4
6 HTTP::Proxy::BodyFilter::lines - A filter that outputs only complete
7 lines
8
10 use HTTP::Proxy::BodyFilter::lines;
11 use MyFilter; # this filter only works on complete lines
12
13 my $filter = MyFilter->new();
14
15 # stack both filters so that they'll handle text/* responses
16 $proxy->push_filter(
17 mime => 'text/*',
18 response => HTTP::Proxy::BodyFilter::lines->new,
19 response => $filter
20 );
21
22 # I want my lines to end with '!'
23 # This is equivalent to $/ = '!' in a normal Perl program
24 my $lines = HTTP::Proxy::BodyFilter::lines->new('!');
25
27 The HTTP::Proxy::BodyFilter::lines filter makes sure that the next
28 filter in the filter chain will only receive complete lines. The
29 "chunks" of data received by the following filters with either end with
30 "\n" or will be the last piece of data for the current HTTP message
31 body.
32
33 You can change the idea the filter has of what is a line by passing to
34 its constructor the string it should understand as line ending. "\n" is
35 the default value.
36
37 my $filter = HTTP::Proxy::BodyFilter::lines->new( $sep );
38
39 This is similar to modifying $/ in a Perl program. In fact, this filter
40 has a behaviour so similar to modifying $/ that it also knows about
41 "paragraph mode" and "record mode".
42
43 Note that the "slurp" mode is not supported. Please use
44 HTTP::Proxy::BodyFilter::complete to enable the generic store and
45 forward filter mechanism.
46
48 This filter defines the following methods, which are automatically
49 called:
50
51 init()
52 Initialise the filter with the EOL information.
53
54 filter()
55 Keeps unfinished lines for later.
56
57 will_modify()
58 This method returns a false value, thus indicating to the system
59 that it will not modify data passing through.
60
62 HTTP::Proxy, HTTP::Proxy::BodyFilter.
63
65 Philippe "BooK" Bruhat, <book@cpan.org>.
66
68 Copyright 2003-2015, Philippe Bruhat.
69
71 This module is free software; you can redistribute it or modify it
72 under the same terms as Perl itself.
73
74
75
76perl v5.38.0 2023-07-20 HTTP::Proxy::BodyFilter::lines(3)