1MooseX::Types::Common::USsterrinCgo(n3t)ributed Perl DocMuomoesnetXa:t:iToynpes::Common::String(3)
2
3
4
6 MooseX::Types::Common::String - Commonly used string types
7
9 version 0.001014
10
12 use MooseX::Types::Common::String qw/SimpleStr/;
13 has short_str => (is => 'rw', isa => SimpleStr);
14
15 ...
16 #this will fail
17 $object->short_str("string\nwith\nbreaks");
18
20 A set of commonly-used string type constraints that do not ship with
21 Moose by default.
22
23 · "SimpleStr"
24
25 A "Str" with no new-line characters and length <= 255.
26
27 · "NonEmptySimpleStr"
28
29 A "SimpleStr" with length > 0.
30
31 · "LowerCaseSimpleStr"
32
33 A "NonEmptySimpleStr" with no uppercase characters. A coercion
34 exists via "lc" from "NonEmptySimpleStr".
35
36 · "UpperCaseSimpleStr"
37
38 A "NonEmptySimpleStr" with no lowercase characters. A coercion
39 exists via "uc" from "NonEmptySimpleStr".
40
41 · "Password"
42
43 A "NonEmptySimpleStr" with length > 3.
44
45 · "StrongPassword"
46
47 A "NonEmptySimpleStr" with length > 7 containing at least one non-
48 alpha character.
49
50 · "NonEmptyStr"
51
52 A "Str" with length > 0.
53
54 · "LowerCaseStr"
55
56 A "Str" with length > 0 and no uppercase characters. A coercion
57 exists via "lc" from "NonEmptyStr".
58
59 · "UpperCaseStr"
60
61 A "Str" with length > 0 and no lowercase characters. A coercion
62 exists via "uc" from "NonEmptyStr".
63
64 · "NumericCode"
65
66 A "Str" with no new-line characters that consists of only Numeric
67 characters. Examples include, Social Security Numbers, Personal
68 Identification Numbers, Postal Codes, HTTP Status Codes, etc.
69 Supports attempting to coerce from a string that has punctuation or
70 whitespaces in it ( e.g credit card number 4111-1111-1111-1111 ).
71
73 · MooseX::Types::Common::Numeric
74
76 Bugs may be submitted through the RT bug tracker
77 <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types-Common>
78 (or bug-MooseX-Types-Common@rt.cpan.org <mailto:bug-MooseX-Types-
79 Common@rt.cpan.org>).
80
81 There is also a mailing list available for users of this distribution,
82 at <http://lists.perl.org/list/moose.html>.
83
84 There is also an irc channel available for users of this distribution,
85 at "#moose" on "irc.perl.org" <irc://irc.perl.org/#moose>.
86
88 · Matt S Trout - mst (at) shadowcatsystems.co.uk
89 (<http://www.shadowcatsystems.co.uk/>)
90
91 · K. James Cheetham <jamie@shadowcatsystems.co.uk>
92
93 · Guillermo Roditi <groditi@gmail.com>
94
96 This software is copyright (c) 2009 by Matt S Trout - mst (at)
97 shadowcatsystems.co.uk (<http://www.shadowcatsystems.co.uk/>).
98
99 This is free software; you can redistribute it and/or modify it under
100 the same terms as the Perl 5 programming language system itself.
101
102
103
104perl v5.30.1 2020-01-30 MooseX::Types::Common::String(3)