OK, after all these years, I'm finally learning how to create a proper Perl module (yeah, I'm lame). I stumbled upon Module::Starter along with Damian Conway's plugin for it. These seem like great tools for helping me get up and running quickly and doing testing and making sure I document my code.
After installing these two modules, I can now issue a command like module-starter MyModule in my personal module library at ~/perl/perl-lib, (which I have in @INC) and it will set up all the files and the directory structures for testing and packaging my module. Sweet!
But when I go edit the module that was automatically generated for me at ~/perl/perl-lib/MyModule/lib/MyModule and run tests, I get an error:
Now I know I'm getting this error because MyModule.pm is in the MyModule/lib directory. While I could simply add the full path to the test files, I'm assuming there's a better way to handle this. Can someone please clue me in? Thanks.t/00.load.t ....... 1/1 # Failed test 'use MyModule;' # at t/00.load.t line 4. # Tried to use 'MyModule'. # Error: Can't locate MyModule.pm in @INC (you may need to instal +l the MyModule module) (@INC contains: /home/steve/perl/perl-lib /etc +/perl /usr/local/lib/x86_64-linux-gnu/perl/5.20.2 /usr/local/share/pe +rl/5.20.2 /usr/lib/x86_64-linux-gnu/perl5/5.20 /usr/share/perl5 /usr/ +lib/x86_64-linux-gnu/perl/5.20 /usr/share/perl/5.20 /usr/local/lib/si +te_perl .) at t/00.load.t line 4. # BEGIN failed--compilation aborted at t/00.load.t line 4.
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |