Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- 2
- 3package Bill;
- 4
- 5sub new {
- 6 my $class = shift;
- 7 my $id = shift;
- 8
- 9 my $self = {};
- 10
- 11 bless($self, $class);
- 12
- 13 $self->{id} = $id;
- 14
- 15 return $self;
- 16}
- 17
- 18sub getId {
- 19 my $self = shift;
- 20 return $self->{id};
- 21}
- 22
- 23sub setId {
- 24 my $self = shitf;
- 25 my $newId = shift;
- 26
- 27 $self->{id} = $newId;
- 28}
- 29
- 30
- 31sub dump {
- 32 my $self = shift;
- 33
- 34 print "id is : ";
- 35 print $self->{id};
- 36 print "\n";
- 37}
- 381;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement