The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

List::Filter::Transforms::Standard - standard List::Filter transform methods

SYNOPSIS

   # This module is not intended to be used directly
   # See: L<List::Filter::Dispatcher>

DESCRIPTION

This module defines the standard List::Filter transform methods, such as "sequential", which simply performs in order each find-and-replace specified inside the transform.

This is the "transform" analog of List::Filter::Filters::Standard.

METHODS

new

Instantiates a new List::Filter::Transform::Internal object.

Takes an optional hashref as an argument, with named fields identical to the names of the object attributes.

With no arguments, the newly created transform will be empty.

init

Initialize object attributes and then lock them down to prevent accidental creation of new ones.

Note: there is no leading underscore on name "init", though it's arguably an "internal" routine (i.e. not likely to be of use to client code).

List::Filter transform methods

The methods that apply a list of transforms. Each List::Filter transfrom specifies one of these methods to use by default.

They all have identical interfaces: they take two input arguments, a List::Filter transform and a reference to a list of strings to be modified. These methods all return an array reference of strings that have been modified by the transform method.

sequential

Inputs: (1) a List::Filter::Transform object (which contains a list of substitutions to be performed) (2) an arrayref of strings to be transformed (3) an options hash reference:

   Supported option(s):
   override_modifiers

Return: an arrayref of the modified strings.

Note: invalid regular expression modifiers are silently ignored.

MOTIVATION

The motivation for this module's existence is simple parallelism: this is the "transform" analog of List::Filter::Filters::Standard. The case is perhaps not as strong for the existance of this module, since the "sequential" method is all that's really likely to be needed, but one of the goals of this project is "pathological extensibility", so I've tried to hold the door open to the possibility that there's a reason for something besides "sequential" application of a transform.

SEE ALSO

List::Filter

TODO

Write additional methods:

reverse

like sequential, but in reverse order

shuffle

apply in random order

length_sorted

apply regexps in order of length of the regexp (doing it in order of length of matches would be better, but more difficult).

no_chained_changes

like sequential, but verifies that later matches don't match something in the replace field of an earlier substitution. That often (though not always) indicates a bug

AUTHOR

Joseph Brenner, <doom@kzsu.stanford.edu>

COPYRIGHT AND LICENSE

Copyright (C) 2007 by Joseph Brenner

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available.

BUGS

None reported... yet.