logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

MooseX::Types::Common::String - Commonly used string types

Authors

       •   Matt S Trout - mst (at) shadowcat.co.uk (<https://www.shadowcat.co.uk/>)

       •   K. James Cheetham <jamie@shadowcat.co.uk>

       •   Guillermo Roditi <groditi@gmail.com>

Description

       A set of commonly-used string type constraints that do not ship with Moose by default.

       •   "SimpleStr"

           A "Str" with no new-line characters and length <= 255.

       •   "NonEmptySimpleStr"

           A "SimpleStr" with length > 0.

       •   "LowerCaseSimpleStr"

           A   "NonEmptySimpleStr"   with   no   uppercase   characters.   A   coercion  exists  via  "lc"  from
           "NonEmptySimpleStr".

       •   "UpperCaseSimpleStr"

           A  "NonEmptySimpleStr"  with  no  lowercase   characters.   A   coercion   exists   via   "uc"   from
           "NonEmptySimpleStr".

       •   "Password"

           A "NonEmptySimpleStr" with length > 3.

       •   "StrongPassword"

           A "NonEmptySimpleStr" with length > 7 containing at least one non-alpha character.

       •   "NonEmptyStr"

           A "Str" with length > 0.

       •   "LowerCaseStr"

           A "Str" with length > 0 and no uppercase characters.  A coercion exists via "lc" from "NonEmptyStr".

       •   "UpperCaseStr"

           A "Str" with length > 0 and no lowercase characters.  A coercion exists via "uc" from "NonEmptyStr".

       •   "NumericCode"

           A  "Str"  with  no  new-line  characters that consists of only Numeric characters.  Examples include,
           Social Security Numbers, Personal Identification Numbers,  Postal  Codes,  HTTP  Status  Codes,  etc.
           Supports  attempting  to  coerce from a string that has punctuation or whitespaces in it ( e.g credit
           card number 4111-1111-1111-1111 ).

Name

       MooseX::Types::Common::String - Commonly used string types

See Also

       •   MooseX::Types::Common::Numeric

Support

       Bugs        may        be        submitted        through        the        RT        bug         tracker
       <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types-Common>                               (or
       bug-MooseX-Types-Common@rt.cpan.org <mailto:bug-MooseX-Types-Common@rt.cpan.org>).

       There   is   also   a   mailing    list    available    for    users    of    this    distribution,    at
       <http://lists.perl.org/list/moose.html>.

       There  is  also  an  irc  channel available for users of this distribution, at "#moose" on "irc.perl.org"
       <irc://irc.perl.org/#moose>.

Synopsis

           use MooseX::Types::Common::String qw/SimpleStr/;
           has short_str => (is => 'rw', isa => SimpleStr);

           ...
           #this will fail
           $object->short_str("string\nwith\nbreaks");

Version

       version 0.001015

See Also