Badger::Data::Facet::Text::Whitespace(3pm)

Badger::Data::Facet::Text::Whitespace3pm

Validation facet for whitespace

Overview

This module implements a validation facets for munging whitespace on text values.

Methods

This module implement the following methods in addition to those inherited from the Badger::Data::Facet::Text, Badger::Data::Facet and Badger::Base base classes.

validate($text_ref, $type)

This method performs whitespace handling on the text passed by reference as the first argument.

If the pre-defined "action" is "preserve" then the text will be unmodified.

If the "action" is "fold" then all whitespace characters in the text (carriage returns, newlines, tabs) will be converted to spaces.

If the "action" is "collapse" then all whitespace characters will first be converted to spaces as per "fold". Any leading and trailing whitespace is then removed and any sequences of multiple spaces are collapsed to a single space.

Author

Andy Wardley <http://wardley.org/>

From libbadger-perl 0.16-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.