0

I'm learning Perl to write code for an assignment about text mining.

Currently, I'm trying to implement OOP in Perl using the sample code from here: https://www.tutorialspoint.com/perl/perl_object_oriented.htm

The problem is, I am unable to run the code even though the class code is already in the same directory. I got this error message :

Can't locate Person.pm in @INC (you may need to install the Person module 
(@INC contains: C:/Strawberry/perl/site/lib C:/Strawberry/perl/vendor/lib 
C:/Strawberry/perl/lib) at employee.pl line 3.
BEGIN failed--compilation aborted at employee.pl line 3.

When I switched to ActiveState Perl, I have no problem in running the code.

Does anyone know what caused the problem? I've tried searching solution for this but most of them are more related to @INC configuration

melpomene
  • 84,125
  • 8
  • 85
  • 148
Muhamad Iqbal
  • 742
  • 1
  • 4
  • 17
  • You may put your classes anywhere, you just need to tell Perl where to look. Let's say your class is '/home/user/project/src/My/Class.pm' dir. Then before `use My::Class;` you can do `use lib '/home/user/project/src';` – a1111exe Nov 03 '17 at 13:12
  • Hope you can adapt this to Windows-way paths. – a1111exe Nov 03 '17 at 13:13

0 Answers0