Dynamic dependencies

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mbrunell
    New Member
    • Sep 2008
    • 7

    Dynamic dependencies

    Hi,

    Under AIX, I have created a script which is checking URL status. Problems come when I want to check HTTPS URL status...

    To have my script working with HTTPS URLs, I must set the LIBPATH variable correctly :

    Code:
    # LIBPATH=/opt/freeware/lib
    # ./check_url.pl https://myexample.com
    SUCCESS
    200 OK
    If the LIBPATH variable is not set, then....

    Code:
    # LIBPATH=""
    # ./check_url.pl https://myexample.com
    Can't load '/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/Crypt/SSLeay/SSLeay.so' for module Crypt::SSLeay:  0509-022 Cannot load module /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/Crypt/SSLeay/SSLeay.so.
            0509-150   Dependent module /usr/lib/libcrypto.a(libcrypto.so.0.9.7) could not be loaded.
            0509-152   Member libcrypto.so.0.9.7 is not found in archive 
            0509-022 Cannot load module /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/Crypt/SSLeay/SSLeay.so.
            0509-150   Dependent module /usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi/auto/Crypt/SSLeay/SSLeay.so could not be loaded. at /usr/opt/perl5/lib/5.8.2/aix-thread-multi/DynaLoader.pm line 229.
     at scripts/check_url.pl line 22
    Compilation failed in require at scripts/check_url.pl line 22.
    BEGIN failed--compilation aborted at scripts/check_url.pl line 22.

    I've been reading about dynamic dependencies and I think that this is related to that. Does anyone of you is aware of a way to tell PERL that he should use this file /opt/freeware/lib/libcrypto.a instead of /usr/lib/libcrypto.a

    Can I make it work with Dynaloader, if yes...I cannot figure out how !?
  • KevinADC
    Recognized Expert Specialist
    • Jan 2007
    • 4092

    #2
    I don't know the answer or even have a suggestion. If you get no replies here ask on www.perlmonks.c om where there are members with a wider range of experience.

    Comment

    • numberwhun
      Recognized Expert Moderator Specialist
      • May 2007
      • 3467

      #3
      If it is a question of just setting the LIBPATH to what it is supposed to be, then you can do that in the script with the backtics to issue system commands and just put in the AIX command to set ( and export if needed ) the command to set LIBPATH to what it needs to be.

      Regards,

      Jeff

      Comment

      • mbrunell
        New Member
        • Sep 2008
        • 7

        #4
        I will post on the perlmonks website. Thanks.

        I had tried to set the LIBPATH variable at the beginning of my script, but it didn't change anything. It seems like it is already too late!

        Code:
        $ENV{'LIBPATH'}='/opt/freeware/lib';

        Comment

        • KevinADC
          Recognized Expert Specialist
          • Jan 2007
          • 4092

          #5
          Try a BEGIN block:

          Code:
          BEGIN {
              $ENV{'LIBPATH'}='/opt/freeware/lib';
          }

          Comment

          Working...