1MooseX::Types::Util(3)User Contributed Perl DocumentationMooseX::Types::Util(3)
2
3
4

NAME

6       MooseX::Types::Util - Common utility functions for the module
7

DESCRIPTION

9       This package the exportable functions that many parts in MooseX::Types
10       might need.
11

FUNCTIONS

13   filter_tags
14       Takes a list and returns two references. The first is a hash reference
15       containing the tags as keys and the number of their appearance as
16       values.  The second is an array reference containing all other
17       elements.
18
19   has_available_type_export
20         TypeConstraint | Undef = has_available_type_export($package, $name);
21
22       This function allows you to introspect if a given type export is
23       available at this point in time. This means that the $package must have
24       imported a typeconstraint with the name $name, and it must be still in
25       its symbol table.
26
27       Two arguments are expected:
28
29       $package
30           The name of the package to introspect.
31
32       $name
33           The name of the type export to introspect.
34
35       Note that the $name is the exported name of the type, not the declared
36       one. This means that if you use Sub::Exporters functionality to rename
37       an import like this:
38
39         use MyTypes Str => { -as => 'MyStr' };
40
41       you would have to introspect this type like this:
42
43         has_available_type_export $package, 'MyStr';
44
45       The return value will be either the type constraint that belongs to the
46       export or an undefined value.
47

SEE ALSO

49       MooseX::Types::Moose, Exporter
50

AUTHOR

52       See "AUTHOR" in MooseX::Types.
53

LICENSE

55       This program is free software; you can redistribute it and/or modify it
56       under the same terms as perl itself.
57
58
59
60perl v5.12.1                      2010-06-01            MooseX::Types::Util(3)
Impressum