in reply to Re^2: beginner - can't load a module
in thread beginner - can't load a module

This is what i thought but I couldn't get it to work. I created a bin directory in my current directory and copied the file there and it still couldn't find it. I made a bin directory in c:\perl\site\lib and copied the file there and it could find it. I don't understand why the second option worked but the first option failed. The disturbing thing though is that the people who I got these files from are adamant in their installation instructions that you should not move/copy files under any circumstances

Replies are listed 'Best First'.
Re^4: beginner - can't load a module
by Corion (Patriarch) on Oct 16, 2010 at 22:37 UTC

    So, as you didn't post any details, let me make some assumptions. You have a directory tree that looks like this:

    C:/Documents and Settings/Administrator/Desktop/Code/BioPerl/testscrip +t.pl C:/Documents and Settings/Administrator/Desktop/Code/BioPerl/ExecuteCo +nfigureBioMartBuilder.pm

    But looking at the code, there are some errors in it. First of all, the code is invalid, because it uses qw() and you have a path with whitespace in directory/filenames. Change that to:

    use lib 'C:/Documents and Settings/Administrator/Desktop/Code/BioPerl/ +';

    Second, if you use lib, Perl will search modules in and below that directory. And the use statement:

    use bin::ExecuteConfigureBioMartBuilder;

    tells Perl to go looking for a file bin/ExecuteConfigureBioMartBuilder.pm. And it can't find that. So, change your tree to look like the following for example:

    C:/Documents and Settings/Administrator/Desktop/Code/BioPerl/testscrip +t.pl C:/Documents and Settings/Administrator/Desktop/Code/BioPerl/bin/Execu +teConfigureBioMartBuilder.pm

    Then, Perl should find the module.