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

Holy monks,

I am trying to build a few perl rpms on different versions of redhat linux. The spec file contains commands that determine a few directories in /usr/lib/perl5:

perl -V:installvendorlib
perl -V:installvendorarch
I've observed that the above works on some versions only and returns a null string on others. I want to know how these variables are assigned values. Also, is there a simple perl one-liner that returns a list of all such configuration parameters - perhaps as a hash with key and value pairs?

perl's manpage mentions

-V:configvars
and nothing more that that. I also looked in the perlrun manpage but could not find anything useful.

Many thanks!
<Update:

I was looking at the Config module, and figure out I can get all the values I want using

use Config;
foreach (keys %Config) {
  print "$_ => $Config{$_}\n";
}
For some reason, the installvendorlib variable is not defined on one machine. Is there a way to fix this other than recompiling and reinstalling perl ?

Thanks,
Linuxfan

  • Comment on Obtaining list of all -V configvars to perl command line

Replies are listed 'Best First'.
Re: Obtaining list of all -V configvars to perl command line
by ysth (Canon) on Apr 29, 2005 at 02:43 UTC
    You can generally see the configure options a perl was built with by looking at perl -V:config_args, unless Configure was run manually (i.e. without the -d flag) and some answers were changed, or a Policy.sh was used to set some options, or the config.sh file was manually changed after running Configure.

    By default, the vendor stuff isn't set; I think you need to recompile perl to get it set; see "Directories for vendor-supplied add-on files" in INSTALL.