MooseX::Types::Varchar - Str type parameterizable by length.
package MyClass; use Moose; use MooseX::Types::Varchar qw/ Varchar TrimmableVarchar /; has 'attr1' => (is => 'rw', isa => Varchar[40]); has 'attr2' => (is => 'rw', isa => TrimmableVarchar[40], coerce => 1); package main; my $obj = MyClass->new( attr1 => 'this must be under 40 chars', attr2 => 'this will be trimmed to 40 chars', );
This module provides a type based on Str, where a length restriction is paramterizable.
Nothing by default. You will want to request "Varchar", provided as a MooseX::Types type.
Chris Andrews <chris@nodnol.org>
This program is Free software, you may redistribute it under the same terms as Perl itself.
To install MooseX::Types::Varchar, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MooseX::Types::Varchar
CPAN shell
perl -MCPAN -e shell install MooseX::Types::Varchar
For more information on module installation, please visit the detailed CPAN module installation guide.