1MooseX::Types::Perl(3)User Contributed Perl DocumentationMooseX::Types::Perl(3)
2
3
4
6 MooseX::Types::Perl - Moose types that check against Perl syntax
7
9 version 0.101340
10
12 use MooseX::Types::Perl qw(
13 DistName
14
15 ModuleName
16 PackageName
17
18 Identifier
19 SafeIdentifier
20
21 LaxVersionStr
22 StrictVersionStr
23 VersionObject
24 );
25
27 This library provides Moose types for checking things (mostly strings)
28 against syntax that is, or is a reasonable subset of, Perl syntax.
29
31 ModuleName
32 PackageName
33 These types are identical, and expect a string that could be a package
34 or module name. That's basically a bunch of identifiers stuck together
35 with double-colons. One key quirk is that parts of the package name
36 after the first may begin with digits.
37
38 The use of an apostrophe as a package separator is not permitted.
39
40 DistName
41 The DistName type checks for a string like "MooseX-Types-Perl", the
42 sort of thing used to name CPAN distributions. In general, it's like
43 the more familiar ModuleName, but with hyphens instead of double-
44 colons.
45
46 In reality, a few distribution names may not match this pattern -- most
47 famously, "CGI.pm" is the name of the distribution that contains CGI.
48 These exceptions are few and far between, and deciding what a
49 "LaxDistName" type would look like has not seemed worth it, yet.
50
51 Identifier
52 An Identifier is something that could be used as a variable name.
53 Generally, it's a bunch of alphanumeric characters not starting with a
54 digit.
55
56 Although Perl identifiers may contain non-ASCII characters in some
57 circumstances, this type does not allow it. A "UnicodeIdentifier" type
58 may be added in the future.
59
60 SafeIdentifier
61 SafeIdentifiers are just like Identifiers, but omit the single-letter
62 variables underscore, a, and b, as these have special significance.
63
64 LaxVersionStr
65 StrictVersionStr
66 Lax and strict version strings use the is_lax and is_strict methods
67 from "version" to check if the given string would be a valid lax or
68 strict version. version::Internals covers the details but basically:
69 lax versions are everything you may do, and strict omit many of the
70 usages best avoided.
71
72 VersionObject
73 Just for good measure, this type is included to check if a value is a
74 version object. Coercions from LaxVersionStr (and thus
75 StrictVersionStr) are provided.
76
78 Ricardo SIGNES <rjbs@cpan.org>
79
81 This software is copyright (c) 2010 by Ricardo SIGNES.
82
83 This is free software; you can redistribute it and/or modify it under
84 the same terms as the Perl 5 programming language system itself.
85
86
87
88perl v5.12.0 2010-05-15 MooseX::Types::Perl(3)