line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::RandomPerson::Names; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
20
|
use strict; |
|
5
|
|
|
|
|
5
|
|
|
5
|
|
|
|
|
141
|
|
4
|
5
|
|
|
5
|
|
17
|
use warnings; |
|
5
|
|
|
|
|
4
|
|
|
5
|
|
|
|
|
117
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
1219
|
use Data::RandomPerson::Choice; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
188
|
|
7
|
5
|
|
|
5
|
|
1691
|
use File::Share ':all'; |
|
5
|
|
|
|
|
26587
|
|
|
5
|
|
|
|
|
1330
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
34
|
|
|
34
|
1
|
7911
|
my ($class) = @_; |
11
|
|
|
|
|
|
|
|
12
|
34
|
|
|
|
|
62
|
my $self = bless {}, $class; |
13
|
|
|
|
|
|
|
|
14
|
34
|
|
|
|
|
157
|
$self->{choice} = Data::RandomPerson::Choice->new(); |
15
|
|
|
|
|
|
|
|
16
|
34
|
|
|
|
|
112
|
my $module = (split /::/, $class)[-1]; |
17
|
|
|
|
|
|
|
|
18
|
34
|
|
|
|
|
103
|
my $file = dist_file ('Data-RandomPerson', $module . '.txt'); |
19
|
5
|
50
|
|
5
|
|
24
|
open ( my $fh, '< :encoding(UTF8)', $file) or die "Can't open '$file': $!"; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
27
|
|
|
34
|
|
|
|
|
4642
|
|
20
|
34
|
|
|
|
|
39947
|
my @file = <$fh>; |
21
|
34
|
|
|
|
|
104354
|
close $fh; |
22
|
|
|
|
|
|
|
|
23
|
34
|
|
|
|
|
8311
|
chomp (@file); |
24
|
34
|
|
|
|
|
1973
|
$self->{choice}->add_list(@file); |
25
|
|
|
|
|
|
|
|
26
|
34
|
|
|
|
|
5218
|
return $self; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub size { |
30
|
31
|
|
|
31
|
1
|
18418
|
my ($self) = @_; |
31
|
|
|
|
|
|
|
|
32
|
31
|
|
|
|
|
107
|
return $self->{choice}->size(); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub get { |
36
|
1540
|
|
|
1540
|
1
|
100018391
|
my ($self) = @_; |
37
|
|
|
|
|
|
|
|
38
|
1540
|
|
|
|
|
5505
|
return $self->{choice}->pick(); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |