Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Can't locate AMOS/ in @INC

by Jeri (Scribe)
on May 18, 2012 at 15:22 UTC ( #971327=perlquestion: print w/ replies, xml ) Need Help??
Jeri has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks! My perl module cannot be found, but it is definitely installed on my computer. Here I verify it.
jdilts@jdilts-VirtualBox:~$ sudo find ./ -name "AmosLib.*" [sudo] password for jdilts: ./.local/share/Trash/files/bin/amos-3.1.0-rc1/src/PerlModules/AmosLib. +pm ./.local/share/Trash/files/src/PerlModules/
The strange part is when I do a search in the GUI over my whole file system. It also finds two instances of, but not in the same location.

When I run my script I get this error.
Can't locate AMOS/ in @INC (@INC contains: /etc/perl /usr/lo +cal/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/ +share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/si +te_perl .) at /usr/local/bin/amos-3.1.0-rc1/src/Converters/tarchive2a line 5. BEGIN failed--compilation aborted at /usr/local/bin/amos-3.1.0-rc1/src +/Converters/ line 5.
It seems my program wants to find in the AMOS directory which was found by my GUI search and not by the terminal find command. So, I decided to do an export to that directory and I look at my PERL5LIB path.
jdilts@jdilts-VirtualBox:~$ export PERL5LIB=/usr/local/bin/amos-3.1.0- +rc1/lib/AMOS:$PERL5LIB jdilts@jdilts-VirtualBox:~$echo $PERL5LIB /usr/local/bin/amos-3.1.0-rc1/lib/AMOS:/usr/local/bin/amos-3.1.0-rc1/s +rc/PerlModules:/home/jdilts/perl5/lib/perl5/i686-linux-gnu-thread-mul +ti-64int:/home/jdilts/perl5/lib/perl5
Okay good. Now my script should work, but no. I get the same error and don't see the directory I inserted into the PERL5LIB.
Can't locate AMOS/ in @INC (@INC contains: /etc/perl /usr/lo +cal/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/ +share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/si +te_perl .) at /usr/local/bin/amos-3.1.0-rc1/src/Converters/tarchive2a line 5. BEGIN failed--compilation aborted at /usr/local/bin/amos-3.1.0-rc1/src +/Converters/ line
I'm not sure what I'm doing wrong. All help is greatly appreciated! Thanks!

Comment on Can't locate AMOS/ in @INC
Select or Download Code
Replies are listed 'Best First'.
Re: Can't locate AMOS/ in @INC
by toolic (Bishop) on May 18, 2012 at 15:28 UTC
    If your file declares package AMOS::AmosLib;, then change:
    export PERL5LIB=/usr/local/bin/amos-3.1.0-rc1/lib/AMOS:$PERL5LIB


    export PERL5LIB=/usr/local/bin/amos-3.1.0-rc1/lib:$PERL5LIB

    See also: Simple Module Tutorial and require

      Okay. I checked the file. It was AMOS::AmosLib like you suspected. So I changed the export and got the same error with no change. I also tried putting the .pm in the /etc/perl directory.
        Create a new script with just these lines in it:
        #!/usr/bin/env perl use Data::Dumper; print Dumper(\@INC); print "$_\n" for glob '/usr/local/bin/amos-3.1.0-rc1/lib'
        Run it and post the results in readmore tags.
        I also tried putting the .pm in the /etc/perl directory.

        Did you put in /etc/perl/AMOS/?

        Improve your skills with Modern Perl: the free book.

        Honestly, I'm not trying to be a burden. I just need to know how to get a path I want into @INC. Thanks!
Re: Can't locate AMOS/ in @INC
by runrig (Abbot) on May 18, 2012 at 18:56 UTC
    With PERL5LIB set, run perl -V. is there an AMOS directory in one of the directories listed in the @INC list at the end? Does that directory contain Is the AMOS directory and the file readable by you? Does perldoc -m AMOS::AmosLib find the source?
Re: Can't locate AMOS/ in @INC
by Eliya (Vicar) on May 18, 2012 at 16:43 UTC
    ...and don't see the directory I inserted into the PERL5LIB

    Did you run the Perl script from the same shell where you exported PERL5LIB?


        Well, if this is true, your perl is broken :)  Or your script resets @INC.  Or your script runs in taint mode (-T).  Or you showed the wrong error message in your OP.

        Items in PERL5LIB should otherwise always appear in the reported @INC:

        $ PERL5LIB=/foo/bar perl -MNot::Exist -e1 Can't locate Not/ in @INC (@INC contains: /foo/bar /etc/perl / +usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 + /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/ +lib/site_perl .). BEGIN failed--compilation aborted.

        As you can see, /foo/bar has been added to @INC.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2015-11-29 02:43 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls