1MooseX::Types::StringliUksee(r3)Contributed Perl DocumenMtoaotsieoXn::Types::Stringlike(3)
2
3
4
6 MooseX::Types::Stringlike - Moose type constraints for strings or
7 string-like objects
8
10 version 0.003
11
13 package Foo;
14 use Moose;
15 use MooseX::Types::Stringlike qw/Stringlike Stringable ArrayRefOfStringlike ArrayRefOfStringable/;
16
17 has path => (
18 is => 'ro',
19 isa => Stringlike,
20 coerce => 1
21 );
22
23 has stringable_object => (
24 is => 'ro',
25 isa => Stringable,
26 );
27
28 has paths => (
29 is => 'ro',
30 isa => ArrayRefOfStringlike,
31 coerce => 1
32 );
33
34 has stringable_objects => (
35 is => 'ro',
36 isa => ArrayRefOfStringable,
37 );
38
40 This module provides a more general version of the "Str" type. If
41 coercions are enabled, it will accepts objects that overload
42 stringification and coerces them into strings.
43
45 This module uses MooseX::Types to define the following subtypes.
46
47 Stringlike
48 "Stringlike" is a subtype of "Str". It can coerce "Stringable" objects
49 into a string.
50
51 Stringable
52 "Stringable" is a subtype of "Object" where the object has overloaded
53 stringification.
54
55 ArrayRefOfStringlike
56 "ArrayRefStringlike" is a subtype of "ArrayRef[Str]". It can coerce
57 "ArrayRefOfStringable" objects into an arrayref of strings.
58
59 ArrayRefOfStringable
60 "ArrayRefOfStringable" is a subtype of "ArrayRef[Object]" where the
61 objects have overloaded stringification.
62
64 • Moose::Manual::Types
65
66 • MooseX::Types
67
68 • MooseX::Types::Moose
69
71 Thank you to Dagfinn Ilmari Mannsåker for the idea on IRC that led to
72 this module.
73
75 Bugs / Feature Requests
76 Please report any bugs or feature requests through the issue tracker at
77 <https://github.com/dagolden/MooseX-Types-Stringlike/issues>. You will
78 be notified automatically of any progress on your issue.
79
80 Source Code
81 This is open source software. The code repository is available for
82 public review and contribution under the terms of the license.
83
84 <https://github.com/dagolden/MooseX-Types-Stringlike>
85
86 git clone https://github.com/dagolden/MooseX-Types-Stringlike.git
87
89 David Golden <dagolden@cpan.org>
90
92 Karen Etheridge <ether@cpan.org>
93
95 This software is Copyright (c) 2012 by David Golden.
96
97 This is free software, licensed under:
98
99 The Apache License, Version 2.0, January 2004
100
101
102
103perl v5.34.0 2022-01-21 MooseX::Types::Stringlike(3)