in reply to How to setup the DynaLoader in a dynamically loaded perl?

When linking with --rpath=. the shared library must be in the current directory. What I would want is that the shared library is looked up there where the application is.
man 8 ld.so:

The dynamic linker understands certain token strings in an rpath specification (DT_RPATH or DT_RUNPATH). Those strings are substituted as follows:

Replies are listed 'Best First'.
Re^2: How to setup the DynaLoader in a dynamically loaded perl?
by sciurius (Beadle) on May 06, 2020 at 12:15 UTC

    Fantastic! That's exactly what I'm looking for.

    (Interesting: in "man ld" $ORIGIN is only mentioned in the context of --rpath-link so I didn't think this was appliccable in this case. Thank you for pointing out.)