http://www.perlmonks.org?node_id=922820


in reply to Re: Directory Structure
in thread Directory Structure

I am giving exact code and error
I have two folders one is hello and second one is myfolder. Both the folder are parallel like A and B
. Folder hello contains hello.pl and myfolder folder contains package1.pm
Both the folder are in eg folder
hello.pl
#!/usr/local/bin/perl
use Data::Dumper;
use eg::myfolder::package1;
print @INC;
my $package1 = new package1();
warn "package ".Dumper($package1);
my $prnt = package1::DESTROY();
print "$prnt";

package1.pm
package package1;
sub new {
my($class, $name) = @_; # Class name is in the first parameter
my $self = { name => $name }; # Anonymous hash reference holds instance attributes
bless($self, $class); # Say: $self is a $class return $self;
}

sub DESTROY {
return 'package2';
}
1;
Error :

Can't locate eg/myfolder/package1.pm in @INC (@INC contains: C:/Perl/site/lib C: /Perl/lib .) at hello.pl line 3. BEGIN failed--compilation aborted at hello.pl line 3.