tommyxd has asked for the wisdom of the Perl Monks concerning the following question:
Hello, everyone!
I'm currently working on a Perl chess project and I have all my modules in separate .pm files. My directory tree is looking like this:
+ Chess + Piece + Bishop.pm + King.pm + Knight.pm + Pawn.pm + Board.pm + Piece.pm + Square.pm + Tests + Bishop.pl + King.pl + Knight.pl + Pawn.pl + Square.pl
I'm currently trying to write some tests, and I can't seem to be able to access any of the .pm files in the Chess/ or Chess/Piece directories. I kept getting the error: "Can't locate *.pm in @INC (@INC contains: ...)", so I tried adding my working directory to @INC with a code like this:
BEGIN { push @INC, "path/to/directory/of/chess-square"; } use Chess::Square;
This got me nowhere, so I tried this as an alternative:
use lib "path/to/directory/of/chess-square"; use Chess::Square;
This didn't work either..
So, PerlMonks, can you help me out? How can I write the following code with my directory structure being as it is?
use Chess::Square; use strict; my $square = Chess::Square->new();
I'm using Windows and ActiveState Perl.
Any help will be greatly appreciated!
Regards,
Tommy
|
---|