line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of MooseX-Types-Tied |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is Copyright (c) 2011 by Chris Weyl. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This is free software, licensed under: |
7
|
|
|
|
|
|
|
# |
8
|
|
|
|
|
|
|
# The GNU Lesser General Public License, Version 2.1, February 1999 |
9
|
|
|
|
|
|
|
# |
10
|
|
|
|
|
|
|
package MooseX::Types::Tied; |
11
|
|
|
|
|
|
|
{ |
12
|
|
|
|
|
|
|
$MooseX::Types::Tied::VERSION = '0.003'; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# ABSTRACT: Basic tied Moose types library |
16
|
|
|
|
|
|
|
|
17
|
3
|
|
|
3
|
|
40733
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
129
|
|
18
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
134
|
|
19
|
|
|
|
|
|
|
|
20
|
3
|
|
|
3
|
|
1138
|
use MooseX::Types -declare => [ qw{ Tied TiedHash TiedArray TiedHandle } ]; |
|
3
|
|
|
|
|
5914498
|
|
|
3
|
|
|
|
|
51
|
|
21
|
3
|
|
|
3
|
|
21933
|
use MooseX::Types::Moose ':all'; |
|
3
|
|
|
|
|
17347
|
|
|
3
|
|
|
|
|
31
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#use namespace::clean; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
subtype Tied, |
26
|
|
|
|
|
|
|
as Ref, |
27
|
|
|
|
|
|
|
where { defined tied $$_ }, |
28
|
|
|
|
|
|
|
message { 'Referenced scalar is not tied!' }, |
29
|
|
|
|
|
|
|
; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
subtype TiedArray, |
32
|
|
|
|
|
|
|
as ArrayRef, |
33
|
|
|
|
|
|
|
where { defined tied @$_ }, |
34
|
|
|
|
|
|
|
message { 'Array is not tied!' }, |
35
|
|
|
|
|
|
|
; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
subtype TiedHash, |
38
|
|
|
|
|
|
|
as HashRef, |
39
|
|
|
|
|
|
|
where { defined tied %$_ }, |
40
|
|
|
|
|
|
|
message { 'Hash is not tied!' }, |
41
|
|
|
|
|
|
|
; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
subtype TiedHandle, |
44
|
|
|
|
|
|
|
as FileHandle, |
45
|
|
|
|
|
|
|
where { defined tied $$_ }, |
46
|
|
|
|
|
|
|
message { 'Handle is not tied!' }, |
47
|
|
|
|
|
|
|
; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=pod |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=encoding utf-8 |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 NAME |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
MooseX::Types::Tied - Basic tied Moose types library |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 VERSION |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
This document describes version 0.003 of MooseX::Types::Tied - released April 21, 2012 as part of MooseX-Types-Tied. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SYNOPSIS |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
use Moose; |
68
|
|
|
|
|
|
|
use MooseX::Types::Tied ':all'; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
has tied_array => (is => 'ro', isa => TiedArray); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
# etc... |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 DESCRIPTION |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This is a collection of basic L<Moose> types for tied references. The package |
77
|
|
|
|
|
|
|
behaves as you'd expect a L<MooseX::Types> library to act: either specify the |
78
|
|
|
|
|
|
|
types you want imported explicitly or use the ':all' catchall. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=for stopwords TiedArray TiedHash TiedHandle |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 TYPES |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head2 Tied |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
Base type: Ref (to Scalar) |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head2 TiedArray |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Base type: ArrayRef |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 TiedHash |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
Base type: HashRef |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=head2 TiedHandle |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Base type: FileHandle |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=head1 SOURCE |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
The development version is on github at L<http://github.com/RsrchBoy/moosex-types-tied> |
103
|
|
|
|
|
|
|
and may be cloned from L<git://github.com/RsrchBoy/moosex-types-tied.git> |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 BUGS |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website |
108
|
|
|
|
|
|
|
https://github.com/RsrchBoy/moosex-types-tied/issues |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
111
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
112
|
|
|
|
|
|
|
feature. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 AUTHOR |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Chris Weyl <cweyl@alumni.drew.edu> |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
This software is Copyright (c) 2011 by Chris Weyl. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
This is free software, licensed under: |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
The GNU Lesser General Public License, Version 2.1, February 1999 |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=cut |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
__END__ |
130
|
|
|
|
|
|
|
|