![]() |
![]()
| ![]() |
![]()
NAMEHTTP::Proxy::BodyFilter::simple - A class for creating simple filters SYNOPSISuse HTTP::Proxy::BodyFilter::simple; # a simple s/// filter my $filter = HTTP::Proxy::BodyFilter::simple->new( sub { ${ $_[1] } =~ s/foo/bar/g; } ); $proxy->push_filter( response => $filter ); DESCRIPTIONHTTP::Proxy::BodyFilter::simple can create BodyFilter without going through the hassle of creating a full-fledged class. Simply pass a code reference to the filter() method of your filter to the constructor, and you'll get the adequate filter. Constructor calling conventionThe constructor can be called in several ways, which are shown in the synopsis:
METHODSThis filter "factory" defines the standard HTTP::Proxy::BodyFilter methods, but those are only, erm, "proxies" to the actual CODE references passed to the constructor. These "proxy" methods are: Two other methods are actually HTTP::Proxy::BodyFilter::simple methods, and are called automatically:
There is also a method that returns a boolean value:
SEE ALSOHTTP::Proxy, HTTP::Proxy::BodyFilter. AUTHORPhilippe "BooK" Bruhat, <book@cpan.org>. COPYRIGHTCopyright 2003-2015, Philippe Bruhat. LICENSEThis module is free software; you can redistribute it or modify it under the same terms as Perl itself.
|