You need to find where the modules were installed so that you can supply those paths to lib pragma: use lib '/path/to/module';. Or, install the software on your own in known locations.

One way to find the file paths of system installed software ...

# Locate LWP::UserAgent. % rpm -qa | fgrep -i useragent # Take the name from above to find the installed paths. % rpm -ql <package name> | fgrep LWP/UserAgent

Then use the paths from above command output to supply to lib pragma.

Below is an example for "DBD::SQLite" module installed here on CentOS 8 ...

% rpm -qa | egrep -i '(perl|p5).+SQLite' perl-DBD-SQLite-1.58-2.module_el8.1.0+207+bdacd7b7.x86_64 % rpm -ql perl-DBD-SQLite-1.58-2.module_el8.1.0+207+bdacd7b7.x86_64 | +fgrep 'DBD/SQLite' /usr/lib64/perl5/vendor_perl/DBD/SQLite /usr/lib64/perl5/vendor_perl/DBD/SQLite.pm /usr/lib64/perl5/vendor_perl/DBD/SQLite/Constants.pm /usr/lib64/perl5/vendor_perl/DBD/SQLite/Cookbook.pod /usr/lib64/perl5/vendor_perl/DBD/SQLite/Fulltext_search.pod /usr/lib64/perl5/vendor_perl/DBD/SQLite/VirtualTable /usr/lib64/perl5/vendor_perl/DBD/SQLite/VirtualTable.pm /usr/lib64/perl5/vendor_perl/DBD/SQLite/VirtualTable/FileContent.pm /usr/lib64/perl5/vendor_perl/DBD/SQLite/VirtualTable/PerlData.pm /usr/lib64/perl5/vendor_perl/auto/DBD/SQLite /usr/lib64/perl5/vendor_perl/auto/DBD/SQLite/SQLite.so # In Perl program, if "/usr/lib64/perl5/vendor_perl" had not been # already included in @INC which it is per "perl -V" (near the bottom) +. ... use lib q[/usr/lib64/perl5/vendor_perl]; ...

In reply to Re: Weird perl issue, installed packages not being recognized by parv
in thread Weird perl issue, installed packages not being recognized by kvn95ss

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.