calivw78 has asked for the wisdom of the Perl Monks concerning the following question:

Trying to index a set of text files using swish3. I believe there may be an issue due to some modules being installed via CPAN and others via package management. I was wondering if anyone could take a look at the output below and see if they noticed any issues. From what I can tell, the perl module does exist, and @inc is indeed looking in the location where the perl module is installed. My novice ways have failed me. Thanks in advance.

I believe that the new perl install for 5.10.1 is whats being used. The modules appear to be there as well. However, compilation errors abound.
[root@host]# swish3 -S mailfs -i /home/mail-archive/test/* Can't locate DateTime/Infinite.pm in @INC (@INC contains: /usr/local/l +ib/perl5/site_perl/5.10.1//usr/local/lib/perl5/5.10.1/BSDPAN /usr/loc +al/lib/perl5/site_perl/5.10.1//usr/local/lib/perl5/site_perl/5.10.1/m +ach /usr/local/lib/perl5/site_perl/5.10.1//usr/local/lib/perl5/site_p +erl/5.10.1 /usr/local/lib/perl5/site_perl/5.10.1//usr/local/lib/perl5 +/5.10.1/mach /usr/local/lib/perl5/site_perl/5.10.1//usr/local/lib/per +l5/5.10.1 /usr/local/lib/perl5/site_perl/5.10.1/. /usr/local/lib/perl +5/5.10.1/BSDPAN /usr/local/lib/perl5/site_perl/5.10.1/mach /usr/local +/lib/perl5/site_perl/5.10.1 /usr/local/lib/perl5/5.10.1/mach /usr/loc +al/lib/perl5/5.10.1 .) at /usr/local/lib/perl5/site_perl/5.10.1/./Ros +e/DateTime/Util.pm line 8. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +10.1/./Rose/DateTime/Util.pm line 8. Compilation failed in require at /usr/local/bin/swish3 line 21. BEGIN failed--compilation aborted at /usr/local/bin/swish3 line 21. [root@host]#
Line 21 of /usr/local/bin/swish3 is...
use Rose::DateTime::Util qw(parse_date);
That module appears to still be installed ok
[root@system /]# cpan -D Rose::DateTime CPAN: Storable loaded ok (v2.20) Going to read '/.cpan/Metadata' Database was generated on Sat, 26 Mar 2011 05:28:30 GMT CPAN: LWP::UserAgent loaded ok (v6.00) CPAN: Time::HiRes loaded ok (v1.9719) Fetching with LWP: http://cpan.yimg.com/authors/01mailrc.txt.gz CPAN: YAML loaded ok (v0.72) Going to read '/.cpan/sources/authors/01mailrc.txt.gz' CPAN: Compress::Zlib loaded ok (v2.02) ...................................................................... +......DONE Fetching with LWP: http://cpan.yimg.com/modules/02packages.details.txt.gz Going to read '/.cpan/sources/modules/02packages.details.txt.gz' Database was generated on Tue, 03 May 2011 17:29:44 GMT ...................................................................... +......DONE Fetching with LWP: http://cpan.yimg.com/modules/03modlist.data.gz Going to read '/.cpan/sources/modules/03modlist.data.gz' ...................................................................... +......DONE Going to write /.cpan/Metadata Rose::DateTime ---------------------------------------------------------------------- +--- CPAN: Module::CoreList loaded ok (v2.18) DateTime helper functions and parser objects J/JS/JSIRACUSA/Rose-DateTime-0.535.tar.gz /usr/local/lib/perl5/site_perl/5.10.1/Rose/DateTime.pm Installed: 0.535 CPAN: 0.535 up to date John Siracusa (JSIRACUSA) siracusa@gmail.com

Replies are listed 'Best First'.
Re: Problems locating modules
by toolic (Bishop) on May 15, 2011 at 14:54 UTC
    Can't locate DateTime/Infinite.pm in @INC
    It seems like DateTime::Infinite is not installed. Try to install it:
    cpan DateTime::Infinite
Re: Problems locating modules
by Khen1950fx (Canon) on May 15, 2011 at 17:21 UTC
    You're probably missing Rose::Object and a few other dependencies. Here's a Rose::DB bundle. There's 68 dependencies, so have fun.
    #!/usr/bin/perl use strict; use warnings; use CPAN; CPAN::Shell->install( "DateTime", "DateTime::Format::Pg", "DBI", "Time::Clock", "Convert::NLS_DATE_FORMAT", "DateTime::Format::Oracle", "Sub::Install", "Params::Util", "Data::OptList", "Sub::Exporter", "SQL::ReservedWords", "Storable", "Carp::Clan", "Bit::Vector::Overload", "Rose::Object", "Task::Weaken", "Class::Factory::Util", "DateTime::Format::Strptime", "DateTime::Format::Builder", "Time::Local", "Math::Round", "List::MoreUtils", "DateTime::Locale", "Try::Tiny", "Test::Fatal", "Encode", "Test", "Text::Wrap", "Pod::Escapes", "Pod::Simple", "Pod::Man", "ExtUtils::MakeMaker", "Class::Load", "parent", "ExtUtils::ParseXS", "Module::CoreList", "Module::Load", "Params::Check", "Module::Load::Conditional", "Locale::Maketext::Simple", "IPC::Cmd", "ExtUtils::CBuilder", "Perl::OSType", "IO::Dir", "Version::Requirements", "Exporter", "CPAN::Meta", "CPAN::Meta::YAML", "JSON", "JSON::PP", "Parse::CPAN::Meta", "File::Spec", "File::Temp", "version", "Module::Metadata", "Module::Build", "Attribute::Handlers", "Params::Validate", "Class::Singleton", "DateTime::TimeZone", "Sub::Uplevel", "Test::Exception", "Test::Harness", "Test::More", "Scalar::Util", "DateTime::Format::MySQL", "Clone", "Clone::PP", "Rose::DB");
      You could do away with all those quotes and commas with qw:
      CPAN::Shell->install( qw( DateTime DateTime::Format::Pg DBI ));
        Thanks. I actually prefer the quotes and commas:).

      Thanks for the pointers. I did the recommended module installs, but now there are errors occurring that I've never experienced (not really a surprise)

      [root@host /usr/home/user]# swish3 -S mailfs -i /home/mail-archive/tes +t/* Bareword "DateTime::INFINITY" not allowed while "strict subs" in use a +t /usr/local/lib/perl5/site_perl/5.10.1/mach/DateTime/Infinite.pm lin +e 31. Bareword "DateTime::INFINITY" not allowed while "strict subs" in use a +t /usr/local/lib/perl5/site_perl/5.10.1/mach/DateTime/Infinite.pm lin +e 31. Bareword "DateTime::NEG_INFINITY" not allowed while "strict subs" in u +se at /usr/local/lib/perl5/site_perl/5.10.1/mach/DateTime/Infinite.pm + line 31. BEGIN not safe after errors--compilation aborted at /usr/local/lib/per +l5/site_perl/5.10.1/mach/DateTime/Infinite.pm line 42. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.10.1 +/./Rose/DateTime/Util.pm line 8. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +10.1/./Rose/DateTime/Util.pm line 8. Compilation failed in require at /usr/local/bin/swish3 line 21. BEGIN failed--compilation aborted at /usr/local/bin/swish3 line 21.

      Line 31 of /usr/local/lib/perl5/site_perl/5.10.1/mach/DateTime/Infinite.pm

      30 sub _stringify { 31 $_[0]->{utc_rd_days} == DateTime::INFINITY 32 ? DateTime::INFINITY . '' 33 : DateTime::NEG_INFINITY . ''; 34 }

      Now, /home/mail-archive/test/* is referencing a directory of plain text files. I'm not sure if that is contributing to the "Bareword" error or not. *sigh*

        Maybe you have an old (or broken) installation of DateTime? At least DateTime 0.70 has these two lines:

        use constant INFINITY => ( 9**9**9 ); use constant NEG_INFINITY => -1 * ( 9**9**9 );

        Also, why are you testing the Perl module/program through "swish" instead of trying to eliminate the irrelevant parts? I would start with perl -MDateTime::Infinity -e1 resp. perl -MDateTime -e1 and slowly work my way up the chain until things fail.