Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Student;
- require Exporter;
- use vars qw(@ISA @EXPORT);
- @ISA = qw(Exporter);
- our @EXPORT =('new');
- sub new
- {
- my $class = shift;
- my $self = {
- _name => shift,
- _rank => shift,
- };
- print "Student's name is $self->{_name}n";
- print "Student's rank is $self->{_rank}n";
- bless $self, $class;
- return $self;
- }
- 1;
- use Student;
- $object = new Student( "Ram", "3th");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement