SYNOPSIS

DESCRIPTION

HTTP::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 convention

The constructor can be called in several ways, which are shown in the synopsis:

Initalise the filter instance with the code references passed to the constructor.

can()

Return the actual code reference that will be run, and not the "proxy" methods. If called with any other name than begin, end and filter, calls UNIVERSAL::can() instead.

There is also a method that returns a boolean value:

will_modify()

The will_modify() method returns a scalar value (boolean) indicating if the filter may modify the body data. The default method returns a true value, so you only need to set this value when you are absolutely certain that the filter will not modify data (or at least not modify its final length).

As a valued partner and proud supporter of MetaCPAN, StickerYou is
happy to offer a 10% discount on all Custom Stickers,
Business Labels, Roll Labels,
Vinyl Lettering or Custom Decals. StickerYou.com
is your one-stop shop to make your business stick.
Use code METACPAN10 at checkout to apply your discount.