Murat Ünalan > Data-Type-0.02.02 > Data::Type::Filter

Download:
Data-Type-0.02.02.tar.gz

Annotate this POD

CPAN RT

New  1
Open  0
View/Report Bugs
Source  

NAME ^

Data::Type::Filter - cleans values before normally subjecting to facets

SYNOPSIS ^

  package Data::Type::Object::std_langcode;

    ...

    sub _filters : method 
    { 
       return ( [ 'strip', '\s' ], [ 'chomp' ], [ 'lc' ] ) 
    }

EXAMPLE ^

  package Data::Type::Filter::chomp;

    our @ISA = ( 'Data::Type::Filter::Interface' );

    our $VERSION = '0.01.25';

    sub desc : method { 'chomps' }

    sub info : method { 'chomps' }
    
    sub filter : method
    {
       my $this = shift;

       chomp $Data::Type::value;
    }

FILTERS ^

Data::Type::Filter::chomp

Chomps (as perl chomp()).

Data::Type::Filter::lc

Lower cases (as perl lc()).

Data::Type::Filter::uc

Upper cases (as perl uc()).

Data::Type::Filter::strip( what )

A simple s/what// operation as

   $Data::Type::value =~ s/$what//go;

Data::Type::Filter::collapse( what )

Collapses any arbitrary repeats of what to a single.

CONTACT ^

Sourceforge http://sf.net/projects/datatype is hosting a project dedicated to this module. And I enjoy receiving your comments/suggestion/reports also via http://rt.cpan.org or http://testers.cpan.org.

AUTHOR ^

Murat Uenalan, <muenalan@cpan.org>

syntax highlighting: