in reply to Re^8: Disappointed with latest Strawberry Perl
in thread Disappointed with latest Strawberry Perl

It's only the path where the installer insists on putting Strawberry Perl. You can (after "installation") simply move the directory and patch Config.pm and Config_heavy.pl and CPAN/Config.pm to point to the new directory. I think the fixed installation mostly stems from some weird belief that executables (and especially Perl) are not relocatable by default on Win32.

You will of course need to change $ENV{INCLUDE}, $ENV{LIB} and $ENV{PATH} to reflect the new location as well, but as you're setting up your own environment anyway, that should be no problem either.

  • Comment on Re^9: Disappointed with latest Strawberry Perl

Replies are listed 'Best First'.
Re^10: Disappointed with latest Strawberry Perl
by xdg (Monsignor) on Jan 01, 2008 at 00:42 UTC
    I think the fixed installation mostly stems from some weird belief that executables (and especially Perl) are not relocatable by default on Win32.

    Unless I'm missing something, it's almost completely undocumented short of examining the source code.

    Prompted by your post, from a little experimention and source code browsing in win32/win32.c, it looks like on Windows, perl.exe automatically sets @INC relative to $^X. However, most of the Perl toolchain looks to Config.pm and Config_heavy.pl to determine the right directories for various library paths, which is why things break oddly just moving the directory without patching those files. (I think that is what you're describing is the case.)

    Given that, it should be fairly easy to patch Config.pm and Config_heavy.pl to just set the library paths similarly by looking relative to $^X

    It also looks like perl.exe uses the long path for $^X and the derived pathnames. I wonder if those were the short pathnames instead whether things would work better if Perl were installed in places like "C:\Program Files\perl"?

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      it should be fairly easy to patch Config.pm and Config_heavy.pl to just set the library paths similarly by looking relative to $^X

      I've done that a few times myself. It is, as you suggest, just a matter of hunting through Config.pm and Config_heavy.pl and replacing every occurrence of C:\original\location with D:\new\location (or whatever). Doing it manually (which is the only way I've ever done it) is a little tedious, but only takes a few minutes. As you've noted, @INC is self-adjusting, so there's no problem in that regard.

      Cheers,
      Rob
      Update: Ooops ... I now think xdg might have been suggesting something else than merely editing Config.pm and Config_heavy.pl.

        A post on Perl Monks is not the same as documentation.

        That doc mentions that @INC can be set from registry entries, but doesn't mention that it's otherwise set relative to the executable.

        -xdg

        Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.