Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Changing Perl compile-time configuration settings

by CountZero (Bishop)
on Feb 20, 2008 at 06:57 UTC ( #668959=note: print w/replies, xml ) Need Help??


in reply to Changing Perl compile-time configuration settings

ActiveState Perl provides a batch script "reloc_perl.bat" that in its turn uses the "ActiveState::RelocateTree" module to change all necessary paths when your Perl moves to a new location. It is much more complicated than just adjusting a few config-files (it even looks inside binary files!) so unless ActiveState Perl is totally different from Strawberry Perl I guess that there is more to it than just the config-locations to be changed.

Perhaps you can look at the AS files and be inspired by them?

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

  • Comment on Re: Changing Perl compile-time configuration settings

Replies are listed 'Best First'.
Re^2: Changing Perl compile-time configuration settings
by Corion (Patriarch) on Feb 20, 2008 at 07:07 UTC

    Actually, it's not "much more complicated" - changing the configuration files is all that I found to be needed. I briefly looked at the source of reloc_perl.bat and ActiveState::RelocateTree, and didn't find where the list of files gets passed around.

    I have moved both, ActiveState and Strawberry Perl around, and the only things that needed change were Config.pm and CPAN/Config.pm.

    Update: D'oh - of course, syphilis is right, Config_heavy.pl is another place that needs changing.

      the only things that needed change were Config.pm and CPAN/Config.pm

      If you don't make any changes to Config_heavy.pl there will still be a number of config values pointing to the original location. I would think that would break something sooner or later.

      Though, I guess, perhaps the amendments made in CPAN/Config.pm override those Config_heavy.pl settings ? (I have no experience with CPAN.pm.)

      Cheers,
      Rob

        CPAN's Config.pm almost always overrides Perl's Config.pm and Config_heavy.pm, but that's almost some modules sometimes ignore the parameters CPAN hands to the make utility and ask Perl (usually via use Config; in Makefile.PL) directly for things, often resulting in the compile borking.

        I'm looking at you Glib...

      ...ok... scanning ActiveState::RelocateTree<br< />

      It looks like it checks every file in the ActiveState installation (without reading too much about File::Find), checks with a regex in the check subroutine to see if they contain the $opt{from} string (which is the current $Config{prefix}), then pass the files to the edit subroutine which search and replaces the from location with the to location (and pads binary files).

      It's comprehensive brute force, and probably OTT.

      I should really do a grep for all files with C:\strawberry\ and see how long the list is...

        It's comprehensive brute force, and probably OTT

        I haven't delved into it, but I suspect that a lot of the extra effort it goes to has more to do with PPM than anything else. I was actually quite surprised that such a beast existed .... ++ to CountZero for drawing attention to it.

        Cheers,
        Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://668959]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2022-05-28 20:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?