Different architectures in the same or different directory trees?

In $ work mode, we maintain a set of Perl modules in a central location for easy inclusion through PERL5LIB. Since there is still a reinstallation ahead, and we need to provide modules for both 32-bit and 64-bit architecture, we are interested in installing them in the same directory tree, relying on the $ archname subdirectories or keeping the two architectures completely separate and duplicating each module.

I didn’t really manage to investigate the inner workings of the Perl module search process using $ archname, maybe someone can point me in the right direction.

In your experience, what are the pros and cons of the two approaches?

+5
source share
2 answers

From perldoc lib :

Using use lib LIST;

For each directory in LIST (called $dirhere), the lib module also checks if a directory called $dir/$archname/autoexists exists. If so, the directory $dir/$archnameis considered appropriate for the architecture-specific directory and is added to @INC before $dir.

lib.pmalso checks if directories are called $dir/$versionand $dir/$version/$archnameexist and adds these directories to @INC.

IMHO, more idiomatically - and, I dare say, rely on - use per-architecture subdirectories, for example, standard Perl libraries.

, , , / .

+3

, . , . .

+1

All Articles