ExtUtil...erConfig(3)
π NAME π
ExtUtils::InferConfig β bestie, this module infers the Perl configuration for interpreters that aren't even running yet π§β¨
β¨ SYNOPSIS β¨
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 πΈ
Okay so picture this: there's a perl interpreter just vibing on your filesystem, not currently running, and you're like "girl what's your configuration, what's in your @INC?" This module answers that.
You give it the path, you confirm the current user can actually run it, and it figures out both the config and the @INC of that interpreter. π
The way it does it: 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 β but only for @INC entries that are plain paths. (More on that in CAVEATS, bestie, it's giving limitations π)
π METHODS π
π new
Requires exactly one named parameter: "perl" β the path to the perl interpreter you want to interrogate for info.
Optional parameter: "debug => 1" turns on the debugging mode. π
π¦ get_config
Returns a copy of the %Config::Config hash of the interpreter you specified as a parameter to the constructor.
The very first time this method (or the get_inc method below) gets called, the perl binary is actually run. For every call after that, the info is cached. So like, one run, then it's just vibing in memory. Obsessed. β¨
π get_inc
Returns a copy of the @INC array of the interpreter you specified as a parameter to the constructor.
Caveat, and this one's important: it skips any references (subroutines,"ARRAY"refs, objects) in the@INCarray, because they cannot be reliably stringified! π
The first time this method (or the get_config method avove) gets called, the perl binary is run. For subsequent calls of this method, the information is cached. Same deal, same slay. π«Ά
π CAVEATS π
This module cannot get the non-plain (i.e. non-string) entries of the @INC array! Not me being devastated about refs in @INC. It's just not happening, fr fr. π
π₯ SEE ALSO π₯
You can use this module with ExtUtils::Installed to get information about perl installations that aren't currently running. iykyk π
π«Ά AUTHOR π«Ά
Steffen Mueller, <smueller@cpan.org> β iconic behavior, truly. β
π COPYRIGHT AND LICENSE π
Copyright (C) 2007-2010 by Steffen Mueller
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6 or, at your option, any later version of Perl 5 you may have available.
And that's the whole thing bestie, no notes. This page came to you from the User Contributed Perl Documentation manual, ExtUtil...erConfig(3), courtesy of perl v5.42.0 dated 2025-07-25. Periodt. π
β¨π
π¦ where this page comes from
- fedora 43: perl-ExtUtils-InferConfig 1.04-42.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms