1HTTP::Proxy::BodyFilterU:s:elrinCeosn(t3r)ibuted Perl DoHcTuTmPe:n:tPartoixoyn::BodyFilter::lines(3)
2
3
4

NAME

6       HTTP::Proxy::BodyFilter::lines - A filter that outputs only complete
7       lines
8

SYNOPSIS

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

DESCRIPTION

27       The HTTP::Proxy::BodyFilter::lines filter makes sure that the next fil‐
28       ter in the filter chain will only receive complete lines. The "chunks"
29       of data received by the following filters with either end with "\n" or
30       will be the last piece of data for the current HTTP message body.
31
32       You can change the idea the filter has of what is a line by passing to
33       its constructor the string it should understand as line ending. "\n" is
34       the default value.
35
36           my $filter = HTTP::Proxy::BodyFilter::lines->new( $sep );
37
38       This is similar to modifying $/ in a Perl program. In fact, this filter
39       has a behaviour so similar to modifying $/ that it also knows about
40       "paragraph mode" and "record mode".
41
42       Note that the "slurp" mode is not supported. Please use
43       HTTP::Proxy::BodyFilter::complete to enable the generic store and for‐
44       ward filter mechanism.
45

METHODS

47       This filter defines the following methods, which are automatically
48       called:
49
50       init()
51           Initialise the filter with the EOL information.
52
53       filter()
54           Keeps unfinished lines for later.
55
56       will_modify()
57           This method returns a false value, thus indicating to the system
58           that it will not modify data passing through.
59

SEE ALSO

61       HTTP::Proxy, HTTP::Proxy::BodyFilter.
62

AUTHOR

64       Philippe "BooK" Bruhat, <book@cpan.org>.
65
67       Copyright 2003-2006, Philippe Bruhat.
68

LICENSE

70       This module is free software; you can redistribute it or modify it
71       under the same terms as Perl itself.
72
73
74
75perl v5.8.8                       2006-09-04 HTTP::Proxy::BodyFilter::lines(3)
Impressum