line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Person::CNPclass; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
635271
|
use 5.018002; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
8
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
35
|
|
5
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
43
|
|
6
|
1
|
|
|
1
|
|
7
|
use Carp; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
757
|
|
7
|
|
|
|
|
|
|
#THIS IS NO NEEDED---------------------------------------------------------- |
8
|
|
|
|
|
|
|
#require Exporter; |
9
|
|
|
|
|
|
|
#our @ISA = qw(Exporter); |
10
|
|
|
|
|
|
|
# Items to export into callers namespace by default. Note: do not export |
11
|
|
|
|
|
|
|
# names by default without a very good reason. Use EXPORT_OK instead. |
12
|
|
|
|
|
|
|
# Do not simply export all your public functions/methods/constants. |
13
|
|
|
|
|
|
|
# This allows declaration use Person::CNPclass ':all'; |
14
|
|
|
|
|
|
|
# If you do not need this, moving things directly into @EXPORT or @EXPORT_OK |
15
|
|
|
|
|
|
|
# will save memory. |
16
|
|
|
|
|
|
|
#our %EXPORT_TAGS = ( 'all' => [ qw() ] ); |
17
|
|
|
|
|
|
|
#our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); |
18
|
|
|
|
|
|
|
#our @EXPORT = qw( ); |
19
|
|
|
|
|
|
|
#THIS IS NO NEEDED-------------------------------------------------------END |
20
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
21
|
|
|
|
|
|
|
#Class for storing data about a person: |
22
|
|
|
|
|
|
|
# nume Methods: getNume() setNume() |
23
|
|
|
|
|
|
|
# prenume Methods: getPrenume() setPrenume() |
24
|
|
|
|
|
|
|
# CNP Cod Numeric Personal Methods: getCNP() setCNP() |
25
|
|
|
|
|
|
|
# nrTel |
26
|
|
|
|
|
|
|
# |
27
|
|
|
|
|
|
|
# Email |
28
|
|
|
|
|
|
|
# Author: Mihai Cornel mhcrnl@gmail.com 0722270796 |
29
|
|
|
|
|
|
|
# File: CNPclass1.pm |
30
|
|
|
|
|
|
|
# Date: 20/10/2015 |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Preloaded methods go here.-------------------------------------------- |
33
|
|
|
|
|
|
|
# Class atributes ------------------------------------------- |
34
|
|
|
|
|
|
|
my @Everyone; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# The Constructor ------------------------------------------- |
37
|
|
|
|
|
|
|
sub new { |
38
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
39
|
0
|
|
|
|
|
|
my $self = { |
40
|
|
|
|
|
|
|
_nume => shift, |
41
|
|
|
|
|
|
|
_prenume=> shift, |
42
|
|
|
|
|
|
|
_cnp => shift, |
43
|
|
|
|
|
|
|
_nrTel => shift, |
44
|
|
|
|
|
|
|
}; # hash referance |
45
|
0
|
|
|
|
|
|
bless ($self, $class); # Transformarea referintei in obiect |
46
|
0
|
|
|
|
|
|
$self->_init; |
47
|
0
|
|
|
|
|
|
return $self; # We send object back |
48
|
|
|
|
|
|
|
# Print all the values just for clarification-------------------------- |
49
|
0
|
|
|
|
|
|
print "Numele DVS. este : $self->{_nume}\n"; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub _init { |
53
|
0
|
|
|
0
|
|
|
my $self = shift; |
54
|
0
|
|
|
|
|
|
push @Everyone, $self; |
55
|
0
|
|
|
|
|
|
carp "New object created"; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# Creating Methods (get//set) ---------------------------------------------------- |
59
|
|
|
|
|
|
|
sub getNume { |
60
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
61
|
0
|
0
|
|
|
|
|
unless (ref $self) { |
62
|
0
|
|
|
|
|
|
croak "Should call getNume() with an object, not a class"; |
63
|
|
|
|
|
|
|
} |
64
|
0
|
|
|
|
|
|
return $self->{ _nume }; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
sub setNume { |
68
|
0
|
|
|
0
|
0
|
|
my ($self, $nume) = @_; |
69
|
0
|
0
|
|
|
|
|
$self->{_nume} = $nume if defined ($nume); |
70
|
0
|
|
|
|
|
|
return $self->{_nume}; |
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub getPrenume { |
74
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
75
|
0
|
0
|
|
|
|
|
unless (ref $self) { |
76
|
0
|
|
|
|
|
|
croak "Should call getPrenume() with an object, not a class"; |
77
|
|
|
|
|
|
|
} |
78
|
0
|
|
|
|
|
|
return $self->{_prenume}; |
79
|
|
|
|
|
|
|
} |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
sub setPrenume { |
82
|
0
|
|
|
0
|
0
|
|
my ($self, $prenume) = @_; |
83
|
0
|
0
|
|
|
|
|
$self->{_prenume}= $prenume if defined ($prenume); |
84
|
0
|
|
|
|
|
|
return $self->{_prenume}; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
sub getCNP { |
88
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
89
|
0
|
0
|
|
|
|
|
unless (ref $self) { |
90
|
0
|
|
|
|
|
|
croak "Should call getCNP() with an object, not a class"; |
91
|
|
|
|
|
|
|
} |
92
|
0
|
|
|
|
|
|
return $self->{ _cnp }; |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
sub setCNP { |
96
|
0
|
|
|
0
|
0
|
|
my($self, $cnp) = @_; |
97
|
0
|
0
|
|
|
|
|
$self->{_cnp} = $cnp if defined ($cnp); |
98
|
0
|
|
|
|
|
|
return $self->{_cnp}; |
99
|
|
|
|
|
|
|
} |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub getNrTel { |
102
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
103
|
0
|
0
|
|
|
|
|
unless (ref $self) { |
104
|
0
|
|
|
|
|
|
croak "Should call hrtNrTel() with an object, not a class"; |
105
|
|
|
|
|
|
|
} |
106
|
0
|
|
|
|
|
|
return $self->{_nrTel}; |
107
|
|
|
|
|
|
|
} |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
sub setNrTel { |
110
|
0
|
|
|
0
|
0
|
|
my($self, $nrTel) = @_; |
111
|
0
|
0
|
|
|
|
|
$self->{_nrTel} = $nrTel if defined ($nrTel); |
112
|
0
|
|
|
|
|
|
return $self->{_nrTel}; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
sub afiseazaVersion { |
117
|
|
|
|
|
|
|
#print getNume()." ".getPrenume()."\n"; |
118
|
0
|
|
|
0
|
0
|
|
print "Salut din ROMANIA! This is version $VERSION of this upload script!\n";; |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
1; |
122
|
|
|
|
|
|
|
__END__ |