use lib "path/to/Chess path/to/Chess/Piece";
In this case, when you try to use Chess::Piece, Perl would look for "path/to/Chess path/to/Chess/Piece/Chess/Piece.pm" — so that likely won't work.
Perl essentially does the following to create the full path:
use lib "searchpath"; use Chess::Piece; / / .pm => "searchpath/Chess/Piece.pm"
In reply to Re^2: How to use a .pm file in a .pl file in another directory.
by Eliya
in thread How to use a .pm file in a .pl file in another directory.
by tommyxd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |