ExtUtils::InferConfig - Infer Perl Configuration for non-running interpreters


ExtUtils-InferConfig documentation  | view source Contained in the ExtUtils-InferConfig distribution.

Index


NAME

Top

ExtUtils::InferConfig - Infer Perl Configuration for non-running interpreters

SYNOPSIS

Top

  use ExtUtils::InferConfig;
  my $eic = ExtUtils::InferConfig->new(
    perl => '/path/to/a/perl'
  );

  # Get that interpreters %Config as hash ref
  my $Config = $eic->get_config;

  # Get that interpreters @INC as array ref
  my $INC = $eic->get_inc;

DESCRIPTION

Top

This module can determine the configuration and @INC of a perl interpreter given its path and that it is runnable by the current user.

It runs the interpreter with a one-liner and grabs the %Config hash via STDOUT capturing. Getting the module load paths, @INC, works the same way for @INC entries that are plain paths.

METHODS

Top

new

Requires one named parameter: perl, the path to the perl interpreter to query for information.

Optional parameter: debug => 1 enables the debugging mode.

get_config

Returns a copy of the %Config::Config hash of the intepreter which was specified as a parameter to the constructor.

The first time this method (or the get_inc method below) is called, the perl binary is run. For subsequent calls of this method, the information is cached.

get_inc

Returns a copy of the @INC array of the intepreter which was specified as a parameter to the constructor. Caveat: This skips any references (subroutines, ARRAY refs, objects) in the @INC array because they cannot be reliably stringified!

The first time this method (or the get_config method avove) is called, the perl binary is run. For subsequent calls of this method, the information is cached.

CAVEATS

Top

This module cannot get the non-plain (i.e. non-string) entries of the @INC array!

SEE ALSO

Top

You can use this module with ExtUtils::Installed to get information about perl installations that aren't currently running.

AUTHOR

Top

Steffen Mueller, <smueller@cpan.org>

COPYRIGHT AND LICENSE

Top


ExtUtils-InferConfig documentation  | view source Contained in the ExtUtils-InferConfig distribution.