line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Moose::Autobox::String; |
2
|
|
|
|
|
|
|
# ABSTRACT: the String role |
3
|
14
|
|
|
14
|
|
7183
|
use Moose::Role; |
|
14
|
|
|
|
|
22
|
|
|
14
|
|
|
|
|
86
|
|
4
|
14
|
|
|
14
|
|
57126
|
use namespace::autoclean; |
|
14
|
|
|
|
|
24
|
|
|
14
|
|
|
|
|
100
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.16'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'Moose::Autobox::Value'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
# perl built-ins |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
1
|
104
|
sub lc { CORE::lc $_[0] } |
13
|
1
|
|
|
1
|
1
|
4
|
sub lcfirst { CORE::lcfirst $_[0] } |
14
|
1
|
|
|
1
|
1
|
4
|
sub uc { CORE::uc $_[0] } |
15
|
1
|
|
|
1
|
1
|
6
|
sub ucfirst { CORE::ucfirst $_[0] } |
16
|
2
|
|
|
2
|
1
|
702
|
sub chomp { CORE::chomp $_[0] } |
17
|
2
|
|
|
2
|
1
|
42
|
sub chop { CORE::chop $_[0] } |
18
|
1
|
|
|
1
|
1
|
441
|
sub reverse { CORE::reverse $_[0] } |
19
|
1
|
|
|
1
|
1
|
4
|
sub length { CORE::length $_[0] } |
20
|
1
|
|
|
1
|
1
|
11
|
sub lines { [ CORE::split '\n', $_[0] ] } |
21
|
1
|
|
|
1
|
1
|
6
|
sub words { [ CORE::split ' ', $_[0] ] } |
22
|
|
|
|
|
|
|
sub index { |
23
|
3
|
100
|
|
3
|
1
|
16
|
return CORE::index($_[0], $_[1]) if scalar @_ == 2; |
24
|
1
|
|
|
|
|
5
|
return CORE::index($_[0], $_[1], $_[2]); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
sub rindex { |
27
|
2
|
100
|
|
2
|
1
|
9
|
return CORE::rindex($_[0], $_[1]) if scalar @_ == 2; |
28
|
1
|
|
|
|
|
5
|
return CORE::rindex($_[0], $_[1], $_[2]); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
sub split { |
31
|
1
|
50
|
|
1
|
1
|
28
|
return [ CORE::split($_[1], $_[0]) ] if scalar @_ == 2; |
32
|
0
|
|
|
|
|
|
return [ CORE::split($_[1], $_[0], $_[2]) ]; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=pod |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=encoding UTF-8 |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 NAME |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Moose::Autobox::String - the String role |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 VERSION |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
version 0.16 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SYNOPSIS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
use Moose::Autobox; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
"Hello World"->uc; # HELLO WORLD |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 DESCRIPTION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This is a role to describes a String value. |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 METHODS |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=over 4 |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item C<chomp> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item C<chop> |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item C<index> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item C<lc> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item C<lcfirst> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item C<length> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item C<reverse> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item C<rindex> |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item C<uc> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item C<ucfirst> |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item C<split> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
$string->split($pattern); |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item C<words> |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This is equivalent to splitting on space. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=item C<lines> |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
This is equivalent to splitting on newlines. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=back |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=over 4 |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=item C<meta> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=back |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 SUPPORT |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=Moose-Autobox> |
108
|
|
|
|
|
|
|
(or L<bug-Moose-Autobox@rt.cpan.org|mailto:bug-Moose-Autobox@rt.cpan.org>). |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
There is also a mailing list available for users of this distribution, at |
111
|
|
|
|
|
|
|
L<http://lists.perl.org/list/moose.html>. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
There is also an irc channel available for users of this distribution, at |
114
|
|
|
|
|
|
|
L<C<#moose> on C<irc.perl.org>|irc://irc.perl.org/#moose>. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 AUTHOR |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Stevan Little <stevan.little@iinteractive.com> |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
This software is copyright (c) 2006 by Infinity Interactive, Inc. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
125
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=cut |