Jerald Sheets wrote: > On Mar 4, 2009, at 7:38 AM, 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. > > > enjoy. > > > --j
(Please bottom-post your responses to this list, so that extended threads remain comprehensible. Thank you.) Then I suggest that perhaps the 'use' statement in your functioning program had no double-colons in the module name. This is from perldoc -f require, which is what 'use' employs to load the module: > If [the module] is a bareword, the require assumes a ".pm" > extension and > replaces "::" with "/" in the filename for you, to make it easy > to load standard modules. So use XML::Handler::YAWriter; would make 'require' search for a file 'XML/Handler/YAWriter.pm' in any of the directories in @INC. Even if @INC included '/path/to/pm', a file '/path/to/pm/YAWriter.pm' would not be found: instead it would have to exist as '/path/to/pm/XML/Handler/YAWriter.pm'. Rob -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/