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

I want to upgrade from 5.6.0 to 5.6.1. I don't know what configuration options were used when building 5.6.0; and I want to make sure I use the same ones for 5.6.1.

Is there a way to build perl so it grabs all its configuration options from an existing Config.pm, instead of prompting me?

Replies are listed 'Best First'.
Re: upgrade perl w/same config?
by rjray (Chaplain) on Feb 14, 2002 at 06:21 UTC

    Getting the current configuration into a form useful for a new configuration is easy enough:

    /path/to/current/perl -V':.*' | sed -e 's/^/-D/'

    This will pick up all of the current configuration options, though, including several you won't want. Library path, API-level settings, etc. that are specific to 5.6.0. So I'd use an exclusionary grep:

    perl -V':.*' | egrep -v '(^PERL_|^api_|5\.6\.0)' | sed -e 's/^/-D/ +'

    What I don't know is whether you can backtick-feed that Configure on a command line like so:

    Configure `perl -V':.*' | egrep -v '(^PERL_|^api_|5\.6\.0)' | sed +-e 's/^/-D/'`

    I went through the README, INSTALL and such in the latest source distribution, but I couldn't find a way to feed Configure from a file other than config.sh or Policy.sh. And as I pointed out earlier, you don't want to use all of the elements that would be in config.sh.

    --rjray

      As long as we're talking perl, why not use a perl one-liner instead of sed and grep...
      perl -V':.*' | perl -ne '/^PERL_|^api_|5\.6\.0/ or s/^/-D/, print'

      -Blake

Re: upgrade perl w/same config?
by xtype (Deacon) on Feb 14, 2002 at 03:06 UTC
    I don't know what configuration options were used when building 5.6.0;
    perl -V[:variable] will give you that information.

    You should see something like this without any variables:
    Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
    ...and then all of the information you would want to know.

    I am sure that `Configure` can grab this information itself, read the manuals (INSTALL README etc).

    update: Hmmm... Perhaps this should be an option for the Configure script. "Use current configuration settings, prompt only for new questions." When given the path to your current working perl binary.
Re: upgrade perl w/same config?
by peschkaj (Pilgrim) on Feb 14, 2002 at 13:50 UTC
    The last time I re-built perl, I think I did it through CPAN. That seemed to keep everything built correctly. Perl's install seems to be smarter than me, so I just let it do it's own thing - knowing full well that it does a better job than I could.
Re: upgrade perl w/same config?
by Anonymous Monk on Feb 15, 2002 at 13:42 UTC

    I have used the following script:

    % perl -MConfig -lwe 'exec map $Config{"config_arg$_"}, 0..$Config{config_argc}'

    if you want to add new arguments, try

    % perl -MConfig -lwe 'exec +(map $Config{"config_arg$_"}, 0..$Config{config_argc}), @ARGV' -- -Dusedevel

    Robin