Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??


I'm trying to use PAR::Packer to package a perl script in a standalone binary file. My script is based on a module called sapnwrfc (, which purpose is to create external RFC connections to SAP systems. I use two different systems to test my scripts and my binary files : one(RHEL) which possess the module correctly installed so I can test my scripts and package them, and another(CentOS) which doesn't have the module so I can test the binary files that I made on the first system.

Here is my problem : This module works with a few lib files that I must add on the system I want to use the module for it to work, and I must specify in a environment variable the directory I placed them in... (the variable is called LD_LIBRARY_PATH)

Here is the command line I use to create the binary file :

 pp -o test --lib=/usr/sap/nwrfcsdk/lib/ -M Carp -M sapnwrfc

At first I had an error because the lib weren't recognized by in the system :

Can't load '/tmp/par-726f6f74/cache-cc3f9bec3331e8f2e860f20be9bc3ebcaa +2a5e7d/' for module SAPNW::Connection: can +not open shared object file: No such file or directory at /usr/lib64/ +perl5/5.8.8/x86_64-linux-thread-multi/ line 230. at /usr/lib/perl5/site_perl/5.8.8/PAR/ line 120 Compilation failed in require at line 22. BEGIN failed--compilation aborted at line 22. Compilation failed in require at script/ line 9. BEGIN failed--compilation aborted at script/ line 9.

Then I added the files in the usual directory on the system for the module to recognise them : /usr/sap/nwrfcsdk. But when I relaunched my binary file, I had another error :

Could not open the ICU common library. The following files must be in the path described by the environment variable "LD_LIBRARY_PATH":,, [nlsui0_mt.c 154 +4] pid = 5485 LD_LIBRARY_PATH is currently set to /tmp/par-726f6f74/cache-cc3f9bec33 +31e8f2e860f20be9bc3ebcaa2a5e7d [nlsui0_mt.c 1547] pid = 5485

So I've got two questions :
  1. How can I change an environment variable at the runtime of the binary file
  2. How can I run my binary file whithout having a concern of the presence of this files in the system ? (I supposed I didn't had this problem because I was including the lib files on the beginning...)


In reply to PAR::Packer, trouble to include specific external libraries by HJO

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    [choroba]: Good morning!
    marto waves

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (8)
    As of 2018-05-24 09:15 GMT
    Find Nodes?
      Voting Booth?