in reply to Re^4: @INC not reflecting correctly
in thread @INC not reflecting correctly

Fair point WRT @INC. I still wonder about Config, though.

The portable version of Strawberry Perl is not installed per se. It just lives in a folder and can be moved around without needing any additional steps to tell Perl where it has been moved to. There are some runtime effects on Config based on the location of the binary, and those are what I cannot locate the source of. Whether those have any bearing on @INC is another question, of course.

Edit: I think this is answered by haj in 11136120, and is the Portable module.

Replies are listed 'Best First'.
Re^6: @INC not reflecting correctly
by syphilis (Archbishop) on Aug 28, 2021 at 04:22 UTC
    I still wonder about Config, though.

    It's quite easy to change %Config values - and the same method works on all systems.
    Just create a file named (say) New_Config.pm:
    package New_Config; use Config; my $new = tied %Config; $new->{make} = 'dmake'; $new->{byteorder} = '43215678'; # Specify as many as you like 1;
    Then you'll see:
    C:\>perl -V:byteorder byteorder='12345678'; C:\>perl -MNew_Config -V:byteorder byteorder='43215678'; C:\>perl -V:make make='gmake'; C:\>perl -MNew_Config -V:make make='dmake';
    The first I became aware of this was with Mattia Barbon's EU::FakeConfig.
    This was very useful as it allowed the use of gcc toolchains to build and install XS modules on perl's built using an MSVC toolchain. (This was back in the day when ActiveState were providing perl's built using MSVC-6.0.)

    I haven't checked to see whether this technique is utilised by Strawberry Perl in achieving its relocatability.
    IIRC, on Windows some Config keys can be altered by editing Config.pm and Config_heavy.pl - but there are also keys that, to my knowledge, can only be changed via this "tied hash" approach.

    Cheers,
    Rob
      It's quite easy to change %Config values - and the same method works on all systems. Just create a file named (say) New_Config.pm:
      You should be aware that changing paths in Config.pm has no effect on @INC. The point of the hack in ExtUtils::FakeConfig is to fool other programs about how this Perl has been built. Other programs use Config and act accordingly. For Perl itself it is just a report written at build time, the Perl executable does not read it (unless you start with perl -d as the debugger does use it).
        You should be aware that changing paths in Config.pm has no effect on @INC

        If I've said anything that implies that I was unaware of that then I've done myself a great disservice.

        Cheers,
        Rob