Thread: Perl libs

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    25
    Rep Power
    0

    Perl libs


    Hi,

    I have perl on my server, not installed, but exist because of another program I installed - HP Aegnt.
    That perl is not installed but it exists.
    I can run perl scripts if I use the perl command from the specific path.
    My question is:
    That perl I have can't recognize the following libs:
    LWP::UserAgent
    HTTP::Request::Common

    I want to use those libs but I can't install them on the server.
    Can I use FindBin within the script and make it know those libs?
    I do have the following PM files:
    LWP.pm
    UserAegnt.pm
    Request.pm
    Common.pm

    I've tried the following script:
    use FindBin;
    use lib $FindBin::Bin;
    use LWP::UserAgent;
    use HTTP::Request::Common;

    While having the above PMs at the same directory as the script.

    Thanks.
  2. #2
  3. !~ /m$/
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    May 2004
    Location
    Reno, NV
    Posts
    4,262
    Rep Power
    1810
    I think it's as simple as just using use lib. No need for a module.

    Code:
    use lib '.';
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2013
    Posts
    25
    Rep Power
    0


    Hi,

    It's not working.
    The problem is that I need to use dependencies libs.
    LWP -> UserAgent.
    When you install perl, those libs will be under directories:
    Dir lib -> LWP.pm
    Dir lib\LWP -> UserAgent.pm

    Thanks.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2012
    Posts
    836
    Rep Power
    496
    It should work. What
    Perl Code:
    use lib LIST
    does is simply to add the directories of the list to Perl's search path so that later use statements will find modules which are not located on Perl's default search path. In other words, this will not prevent Perl from finding other modules located somewhere else in Perl's default search path.

    If it does not work, then you probably have something else missing (such as other modules not installed).

    Comments on this post

    • keath agrees

IMN logo majestic logo threadwatch logo seochat tools logo