Hi!
I'm writting perl module using OOP.
All my modules (UTest.pm and Service.pm) are in some_dir/Lib/ folder.
My test script test.pl is in some_dir.
#file UTest.pm
package UTest;
use warnings;
use strict;
sub new {
my $class = shift;
my $self = {
'name' => '',
'condition' => '',
'args' => [],
};
return bless $self, $class;
}
# other sub ...
1;
#file Service.pm
package Service;
use UTest;
our @ISA = qw(UTest);
sub new {
my ($class) = shift;
my $self = UTest->new();
$self->{'captures'} = {};
bless $self, $class;
return $self;
}
#others sub...
1;
#file test.pl
use Lib::Service;
my $service = Service->new;
#... other codes
I get following error when i run test.pl:
Can't locate UTest.pm in @INC (@INC contains: /etc/perl /usr/local/lib
+/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/p
+erl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl
+ .) at Lib/Service.pm line 2.
BEGIN failed--compilation aborted at Lib/Service.pm line 2.
Compilation failed in require at ./mytest.pl line 2.
BEGIN failed--compilation aborted at ./mytest.pl line 2.
Can someone help me?
Thanks.