ted.byers has asked for the wisdom of the Perl Monks concerning the following question:
This is perl 5, version 18, subversion 1, running on OpenSuse 13.1
I have written multiple packages without a problem. Alas, I have a problem I have never encountered before. Here is the error message:
ted@linux-jp04:~/Work/Projects/Acuity> ./test.acuity.pkg.pl Can't locate acuity.pm in @INC (you may need to install the acuity mod +ule) (@INC contains: home/ted/Work/Projects/Acuity/REJBlib /usr/lib/p +erl5/site_perl/5.18.1/x86_64-linux-thread-multi /usr/lib/perl5/site_p +erl/5.18.1 /usr/lib/perl5/vendor_perl/5.18.1/x86_64-linux-thread-mult +i /usr/lib/perl5/vendor_perl/5.18.1 /usr/lib/perl5/5.18.1/x86_64-linu +x-thread-multi /usr/lib/perl5/5.18.1 /usr/lib/perl5/site_perl .) at . +/test.acuity.pkg.pl line 13. BEGIN failed--compilation aborted at ./test.acuity.pkg.pl line 13.
Obviously, the file so named is actually there:
ted@linux-jp04:~/Work/Projects/Acuity> ls ./REJBlib total 32 drwxr-xr-x 2 ted users 4096 Jan 15 17:17 ./ drwxr-xr-x 3 ted users 4096 Jan 15 17:17 ../ -rwxr-xr-x 1 ted users 8983 Jan 15 17:17 acuity.pm* -rwxr-xr-x 1 ted users 8983 Jan 15 16:58 acuity.pm~* ted@linux-jp04:~/Work/Projects/Acuity>
While I am not sure my code is the problem, here are the first few lines of code in my script:
#!/usr/bin/perl -d:NYTProf use warnings; use strict; use DateTime; use IO::All; use DateTime; use Math::Random::MT::Auto qw(rand irand); use lib 'home/ted/Work/Projects/Acuity/REJBlib'; use acuity; $| = 1;
And here are the first few lines of my package:
package acuity; use strict; use Exporter; use Carp; use Digest::MD5 qw(md5 md5_hex md5_base64); use DateTime; use Log::Log4perl qw(:easy get_logger); use LWP::UserAgent; use LWP::Protocol::https; use HTTP::Request; use HTTP::Request::Common; use HTTP::Response; use HTTP::Status; use Encode qw(decode encode); use JSON; use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 1.00; @ISA = qw (Exporter); @EXPORT = (); @EXPORT_OK = qw(check_risk update_risk_data); %EXPORT_TAGS = (All => [qw(&check_risk &update_risk_data)]); my $class_data = {
And the last line in the package file is '1;'
So, it is clear from the error message that the 'use lib' statement had the desired effect, and that the package file exists in the directory specified. So, why is Perl not finding my package?
Any insights would be appreciated.
Thanks
Ted
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problems getting Perl to find my package
by VinsWorldcom (Prior) on Jan 15, 2014 at 22:58 UTC | |
by ted.byers (Monk) on Jan 15, 2014 at 23:18 UTC | |
|
Re: Problems getting Perl to find my package
by tangent (Parson) on Jan 15, 2014 at 22:55 UTC |