Jerald Sheets wrote:
Gunnar Hjalmarsson wrote:
Jerald Sheets wrote:
In your code you can specify the directory location of the pm:

use lib '/path/to/pm';

That makes no sense. It would cause Perl to look for

    /path/to/pm/XML/Handler/YAWriter.pm

and the module would not be found.

Note that I took that example from a functioning program I have in the CNN environment.

You say it doesn't work, I have six million viewers who say it does.

Wow!! I'm so impressed. But you are mistaken.

C:\home>type test.pl
use lib 'C:/home/MyModules';
use Some::Module;

C:\home>type MyModules\Module.pm
package Some::Module;
print "It worked!\n";
1;

C:\home>test.pl
Can't locate Some/Module.pm in @INC (@INC contains: C:/home/MyModules C:/IndigoPerl/perl/site/lib C:/IndigoPerl/perl/lib .) at C:\home\test.pl line 2.
BEGIN failed--compilation aborted at C:\home\test.pl line 2.

C:\home>

So I'm right; it does not work.

This is the result after I had created a directory Some in MyModules, and moved Module.pm there:

C:\home>type test.pl
use lib 'C:/home/MyModules';
use Some::Module;

C:\home>type MyModules\Some\Module.pm
package Some::Module;
print "It worked!\n";
1;

C:\home>test.pl
It worked!

C:\home>

But, as you can see, now I'm no longer specifying the directory location of the pm in the "use lib" statement.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to