I'm working on an example in perl in oops concept.I'm unable to install the perl package modules.
This file is saved with student.pm
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;
This file is saves with person.pl
use Student;
$object = new Student( "Ram", "3th");
I'm getting error message like this Can't locate Student.pm in @INC (you may need to install the Student module) (@INC contains: C:/Perl64/site/lib C:/Perl64/lib)........