Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Problems getting Perl to find my package

by ted.byers (Scribe)
on Jan 15, 2014 at 22:42 UTC ( #1070736=perlquestion: print w/ replies, xml ) Need Help??
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

Comment on Problems getting Perl to find my package
Select or Download Code
Re: Problems getting Perl to find my package
by tangent (Deacon) on Jan 15, 2014 at 22:55 UTC
    I don't use linux but your directory listing shows acuity.pm* and acuity.pm~* but I would think you need acuity.pm (i.e. without the astersik and tilde) edit: oh, I see * means that the file is executable, and ~ a backup
Re: Problems getting Perl to find my package
by VinsWorldcom (Priest) on Jan 15, 2014 at 22:58 UTC

    Should your 'use lib' line actually read:

    use lib '/home/ted/Work/Projects/Acuity/REJBlib'; ^ _________|

    You've omitted the leading slash for root directory.

      Thanks

      That was it. proof I am going blind in my old age.

      Thanks again

      Ted

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1070736]
Approved by toolic
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2014-08-01 06:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (257 votes), past polls