line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::RandomPerson::Names::Last; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
3067
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
102
|
|
4
|
2
|
|
|
2
|
|
9
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
58
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
8
|
use base 'Data::RandomPerson::Names'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
496
|
|
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
328
|
use Data::RandomPerson::Choice; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
305
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
11
|
2
|
|
|
2
|
1
|
358
|
my ($class) = @_; |
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
|
|
8
|
my $self = bless {}, $class; |
14
|
|
|
|
|
|
|
|
15
|
2
|
|
|
|
|
9
|
$self->{choice} = Data::RandomPerson::Choice->new(); |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
|
|
69643
|
my @names = ; |
18
|
2
|
|
|
|
|
4649
|
close DATA; |
19
|
2
|
|
|
|
|
8161
|
chomp (@names); |
20
|
2
|
|
|
|
|
2511
|
$self->{choice}->add_list(@names); |
21
|
|
|
|
|
|
|
|
22
|
2
|
|
|
|
|
7889
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Data::RandomPerson::Names::Last - A list of last names from some census data |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SYNOPSIS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
use Data::RandomPerson::Names::Last; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
my $l = Data::RandomPerson::Names::Last->new(); |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
print $l->get(); |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 DESCRIPTION |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head2 Overview |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Returns a random element from a list of last names culled from some census data. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 Constructors and initialization |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=over 4 |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=item new( ) |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Create the Data::RandomPerson::Names::Last object. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=back |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head2 Class and object methods |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over 4 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item get( ) |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
Returns a random name from the list. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item size( ) |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Returns the size of the list |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=back |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 AUTHOR |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Peter Hickman (peterhi@ntlworld.com) |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 COPYRIGHT |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Copyright (c) 2005, Peter Hickman. This module is |
78
|
|
|
|
|
|
|
free software. It may be used, redistributed and/or modified under the |
79
|
|
|
|
|
|
|
same terms as Perl itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
__DATA__ |