in reply to Loading and using packages dynamically

For your lib path I sometimes just add-in the path right to @INC
push ( @INC, './home/avarus/perl/myPackages/'  );
There could be danger in useing it or not...

Replies are listed 'Best First'.
Re^2: Loading and using packages dynamically
by Anno (Deacon) on Aug 30, 2007 at 13:33 UTC
    There are at least two problems with your suggestion:

  • It doesn't address the original problem that runtime actions are too late to help with use statements in the same file.

  • Qualifying the directory relative to the current directory, as you do in ./home/avarus/perl/myPackages/ makes the function dependent on the current directory. The script must be run in the directory where home/avarus/perl/myPackages lives for the modules to be found.

    Anno