Right now I am using Lubuntu 23.04 x64 on an old DELL desktop computer. I installed Perl, and this is the first time I want to install a third-party module from CPAN. I want to create a Perl program with a graphical user interface, so I decided to download Prima.

I'm not sure how to do this, so if I remember correctly, I need to write: sudo apt-get install Prima

Well, that didn't work. It says, there's no such program.

Okay, then I go to the CPAN website and find Prima and click on download. It downloaded a file called Prima-1.70.tar.gz. Then I opened the terminal and extracted it and moved all of its contents to /usr/share/perl5 which is one of the paths that showed up in the @INC list when I executed: perl -e "print join('--', @INC);" Then I searched for the word "Prima" on PerlMonks and copied and pasted the first example program I saw. I saved this file on my desktop. I called it menutest.pl and then I added the line #!/usr/bin/perl -w in the first line. I made sure the file is executable. I open terminal and try to run it: perl menutest.pl, and this is what it says:

Can't locate Prima.pm in @INC (you may need to install the Prima module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at menutest.pl line 6. BEGIN failed--compilation aborted at menutest.pl line 6.

If you look at this list, the location where I copied Prima's files is right there in the list: /usr/share/perl5

If I go to /usr/share/perl5/Prima/examples, I see a bunch of pl files there. If I try to run any one of them (i.e. perl grid.pl), it gives me the same error message.

What did I do wrong?

Oh wait. Prima.pm is actually not where it's supposed to be. Ok. I moved the pm files from /usr/share/perl5/Prima/Prima to /usr/share/perl5/Prima and then I copied Prima.pm to /usr/share/perl5. All right. Now, perl says it can't locate a "loadable object." What does that mean?

Can't locate loadable object for module Prima in @INC (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at menutest.pl line 6. Compilation failed in require at menutest.pl line 6. BEGIN failed--compilation aborted at menutest.pl line 6.

Arrgh!


In reply to How do I install a Perl module? by harangzsolt33

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.