line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Vitals; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=pod |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=head1 NAME |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
Data::Vitals - The Perl "Vital Statistics" Library |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 DESCRIPTION |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
The world of clothing and fashion works to an annoyingly anacronistic and |
12
|
|
|
|
|
|
|
complicated set of measurements. The Perl "Vital Statistics" Library is an |
13
|
|
|
|
|
|
|
attempt to create a comprehensive set of classes, object and algorithms for |
14
|
|
|
|
|
|
|
working with human-describing data such as height, body measurements, shoe, |
15
|
|
|
|
|
|
|
bra and other clothing sizes. |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
It is not intended to be the end to a means, or the solution to a specific |
18
|
|
|
|
|
|
|
problem, but rather a general package that can be used to build more specific |
19
|
|
|
|
|
|
|
packages. It is intended that the library should be extremely flexible, |
20
|
|
|
|
|
|
|
highly extendible, support locales in some form, and be heavily unit tested |
21
|
|
|
|
|
|
|
to ensure that packages built on top of Data::Vitals have a reliable base. |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Data::Vitals measurement objects are useful for both male and female |
24
|
|
|
|
|
|
|
measurements. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head2 Implementation Style |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
As is generally the case with complex and twisty subjects (such as |
29
|
|
|
|
|
|
|
L) this library is implemented in a highly object-orientated |
30
|
|
|
|
|
|
|
form. |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
For the sake of completeness we take this to rather extreme levels. For |
33
|
|
|
|
|
|
|
example, a Data::Vitals::Waist object specifically refers for a |
34
|
|
|
|
|
|
|
measurement of the circumference of the torso taken at a waist. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head2 Metric and Imperial |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Please note that all measurements are stored and stringified into metric |
39
|
|
|
|
|
|
|
values (although they can be input in various forms). This is for forward |
40
|
|
|
|
|
|
|
compability with the long term worldwide trend towards metrification. For |
41
|
|
|
|
|
|
|
now, locales that use imperial values should explicitly call the various |
42
|
|
|
|
|
|
|
C<< ->as_imperial >> methods. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 Class List |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
L - Height measurement |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
L - General circumference measurement |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
L - Measurement of the circumference around the hips |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
L - Measurement of the circumference around the waist |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
L - The "Frame" measurement. Circumference around the |
55
|
|
|
|
|
|
|
chest, just below the breasts. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
L - Measurement of the circumference around the chest |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
L - Measurement of the circumference around the |
60
|
|
|
|
|
|
|
torso at a position under the arms. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 STATUS |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This contains an implementation of Height measurements, plus a number of |
65
|
|
|
|
|
|
|
measurements of the circumference of the torso at various points. i.e. |
66
|
|
|
|
|
|
|
Hips/Waist/Chest/etc |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Unit testing and documentation is up to date. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Please note that nothing that produces an error (by returning C) sets |
71
|
|
|
|
|
|
|
an error message in any form. This will be resolved in a later version. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Please note that the measurement ranges are very large by default. The |
74
|
|
|
|
|
|
|
maximum allowable values exceed by a small percentage the world records for |
75
|
|
|
|
|
|
|
the various measurements (at the time of writing). |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
However, the minimums of the range may be unsuitable for newborn or premature |
78
|
|
|
|
|
|
|
babies. The ability to customise these ranges will be added in a later |
79
|
|
|
|
|
|
|
version. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 METHODS |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut |
84
|
|
|
|
|
|
|
|
85
|
3
|
|
|
3
|
|
80553
|
use 5.005; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
133
|
|
86
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
95
|
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# Load the entire distribution |
89
|
3
|
|
|
3
|
|
1903
|
use Data::Vitals::Util (); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
52
|
|
90
|
3
|
|
|
3
|
|
2054
|
use Data::Vitals::Height (); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
71
|
|
91
|
3
|
|
|
3
|
|
2195
|
use Data::Vitals::Circumference (); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
55
|
|
92
|
3
|
|
|
3
|
|
1989
|
use Data::Vitals::Hips (); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
43
|
|
93
|
3
|
|
|
3
|
|
1820
|
use Data::Vitals::Waist (); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
46
|
|
94
|
3
|
|
|
3
|
|
1857
|
use Data::Vitals::Frame (); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
47
|
|
95
|
3
|
|
|
3
|
|
2713
|
use Data::Vitals::Chest (); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
45
|
|
96
|
3
|
|
|
3
|
|
1599
|
use Data::Vitals::Underarm (); |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
142
|
|
97
|
|
|
|
|
|
|
|
98
|
3
|
|
|
3
|
|
14
|
use vars qw{$VERSION}; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
103
|
|
99
|
|
|
|
|
|
|
BEGIN { |
100
|
3
|
|
|
3
|
|
696
|
$VERSION = '1.06'; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
##################################################################### |
108
|
|
|
|
|
|
|
# Constructor Shortcuts |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=pod |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head2 height $height |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
The C method creates and returns a height object. It takes as |
115
|
|
|
|
|
|
|
argument a "height string". |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Returns a new L object on success, or C on |
118
|
|
|
|
|
|
|
error. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
sub height { |
123
|
1
|
|
|
1
|
1
|
39
|
Data::Vitals::Height->new($_[1]); |
124
|
|
|
|
|
|
|
} |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
###------------------------------------------------------------------ |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=pod |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head2 hips $circumference |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
The C method creates and returns a hip measurement object. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
It takes as argument a "circumference string" |
135
|
|
|
|
|
|
|
(see L for details) |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
Returns a new L object, or C on error. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=cut |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub hips { |
142
|
1
|
|
|
1
|
1
|
733
|
Data::Vitals::Hips->new($_[1]); |
143
|
|
|
|
|
|
|
} |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
###------------------------------------------------------------------ |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=pod |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
=head2 waist $circumference |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
The C method creates and returns a waist measurement object. |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
It takes as argument a "circumference string" |
154
|
|
|
|
|
|
|
(see L for details) |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Returns a new L object, or C on error. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=cut |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
sub waist { |
161
|
1
|
|
|
1
|
1
|
533
|
Data::Vitals::Waist->new($_[1]); |
162
|
|
|
|
|
|
|
} |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
###------------------------------------------------------------------ |
165
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=pod |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head2 frame $circumference |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
The C method creates and returns a "frame" measurement object. |
171
|
|
|
|
|
|
|
Mainly used for women, the frame is the circumference of the torso over the |
172
|
|
|
|
|
|
|
rib cage, immediately below the breasts and specifically not included any |
173
|
|
|
|
|
|
|
breast material. |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
It takes as argument a "circumference string" |
176
|
|
|
|
|
|
|
(see L for details) |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
Returns a new L object, or C on error. |
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=cut |
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
sub frame { |
183
|
1
|
|
|
1
|
1
|
650
|
Data::Vitals::Frame->new($_[1]); |
184
|
|
|
|
|
|
|
} |
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
###------------------------------------------------------------------ |
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=pod |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head2 chest $circumference |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
The C method creates and returns a chest measurement object. For |
193
|
|
|
|
|
|
|
women, this is also known as a "bust" measurement. |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
It takes as argument a "circumference string" |
196
|
|
|
|
|
|
|
(see L for details) |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
Returns a new L object on success, or C on |
199
|
|
|
|
|
|
|
error. |
200
|
|
|
|
|
|
|
|
201
|
|
|
|
|
|
|
=cut |
202
|
|
|
|
|
|
|
|
203
|
|
|
|
|
|
|
sub chest { |
204
|
1
|
|
|
1
|
1
|
553
|
Data::Vitals::Chest->new($_[1]); |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
###------------------------------------------------------------------ |
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
=pod |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
=head2 bust $circumference |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
The C method is an alias for the L method. |
214
|
|
|
|
|
|
|
|
215
|
|
|
|
|
|
|
=cut |
216
|
|
|
|
|
|
|
|
217
|
|
|
|
|
|
|
sub bust { |
218
|
1
|
|
|
1
|
1
|
817
|
Data::Vitals::Chest->new($_[1]); |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
###------------------------------------------------------------------ |
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=pod |
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
=head2 underarm $circumference |
226
|
|
|
|
|
|
|
|
227
|
|
|
|
|
|
|
The C method creates and returns an underarm measurement object, |
228
|
|
|
|
|
|
|
which is the circumference of the torso under the arms and above (for |
229
|
|
|
|
|
|
|
women) the breasts. |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
It takes as argument a "circumference string" |
232
|
|
|
|
|
|
|
(see L for details) |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
Returns a new L object, or C on error. |
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=cut |
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
sub underarm { |
239
|
1
|
|
|
1
|
1
|
560
|
Data::Vitals::Underarm->new($_[1]); |
240
|
|
|
|
|
|
|
} |
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
###------------------------------------------------------------------ |
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
1; |
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=pod |
247
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
=head1 TO DO |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
- Allow for per-measurement ranges, that can be tweaked if needed in |
251
|
|
|
|
|
|
|
special cases. |
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
- Add Data::Vitals::Weight |
254
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
- Add Data::Vitals::Bra |
256
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
- Add Data::Vitals::Dress (in the various country standards) |
258
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
- Add Data::Vitals::Shoe (in the various country standards) |
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
=head1 SUPPORT |
262
|
|
|
|
|
|
|
|
263
|
|
|
|
|
|
|
Bugs should always be reported via the CPAN bug tracker |
264
|
|
|
|
|
|
|
|
265
|
|
|
|
|
|
|
L |
266
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
For other issues, contact the maintainer. |
268
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
As the author is no longer working in the fashion/modelling industry, |
270
|
|
|
|
|
|
|
volunteers for taking over maintenance would be gratefully accepted. |
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=head1 AUTHORS |
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
Adam Kennedy Eadamk@cpan.orgE |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
=head1 ACKNOWLEGEMENTS |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
Thank you to Phase N (L) for permitting |
279
|
|
|
|
|
|
|
the open sourcing and release of this distribution. |
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
=head1 COPYRIGHT |
282
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
Copyright 2004 - 2008 Adam Kennedy. |
284
|
|
|
|
|
|
|
|
285
|
|
|
|
|
|
|
This program is free software; you can redistribute |
286
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
The full text of the license can be found in the |
289
|
|
|
|
|
|
|
LICENSE file included with this module. |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
=cut |