ExtUtil...erConfig(3)

πŸ“¦
version 1.04 Β· 2 versions
, in fedora 43

πŸ’– 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 @INC array, 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 (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