carcassonne has asked for the wisdom of the Perl Monks concerning the following question:

Monks,

I just took a cursory look at the /usr/lib Perl directories on this X86_64 machine. Why is, for instance, the Crypt module installed in both:

/usr/lib/perl5/site_perl/5.8.7/Crypt/

and

/usr/lib/perl5/site_perl/5.8.7/x86_64-linux-thread-multi/Crypt/

(System is SuSE 10.0)

Does this mean that it's useful in packaging Perl modules specifically for 32-bit architectures ? If so, how does this selection happens ? Is the default, on such machines, to build Perl modules exclusively for 64-bit machines ?

A bit confused here, so it seems ;-)

Replies are listed 'Best First'.
Re: 32-64 bits systems maze
by Thelonius (Priest) on Mar 11, 2006 at 03:50 UTC
    The normal configuration is that pure Perl modules will go in the "sitelib" directory and XS modules go in the "sitearch" directory. You can have different perl binaries compiled with different configurations-- 32-bit v. 64-bit, single-thread v. multi-threaded, etc. The perl binaries can share the same pure Perl modules, but need to have separate shared libraries, so they are put in separate directories. "Crypt" by itself is not a module, just a directory. Crypt::CAST5_PP is a pure Perl module, but Crypt::CAST5 is not. The very important Crypt::CBC is only available as pure Perl.

    You can find out the values of the configuration variables using the Config module:

    use Config '%Config'; print "sitearch = $Config{archlib}\n";
    From the shell, you can also use the -V option: perl -V:sitearch. -V is handy, you can give it lists or regular expression arguments, and you can eval the output to set shell variables:
    perl -V:'site.*' eval `perl -V:'privlib privarch sitelib sitearch'` ls $sitelib/Crypt ls $sitearch/Crypt
    That's backquotes on the eval line, you can also use $(  ), which is typographically clearer than backquotes and can be nested.
    eval $(perl -V:'prefix version archname') echo $prefix/lib/site_perl/$version/$archname
Re: 32-64 bits systems maze
by spiritway (Vicar) on Mar 11, 2006 at 02:18 UTC

    I think that it just means that there's a 64-bit version available if you can use it. You can check your @INC array to see which library is searched first, which will tell you which module will be the default.