in reply to Dynamic Package Loading

Something like

BEGIN{ our $mypath; require SCP_Config; require lib $mypath; }

Should do it. (untested)


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^2: Dynamic Package Loading
by rashley (Scribe) on Dec 16, 2005 at 20:39 UTC
    This produced a syntax error near require lib $mypath;

      Grrr. Of course it does. It needs to be like this

      #! perl -slw use strict; our $path; BEGIN { require SP_Config; } use lib $path; print for @INC;

      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        I take that back. After I fixed my typo, this DID work.

        Thanks!

        Nope:
        Can't locate SP_Config.pm in @INC