Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm installing a module with the typical perl Makefile.Pl; make; make install path. However I don't want to overwrite the old version of the modules instead I want to save the new modules in another directory so I can "use lib" them when I need the new version. This way I can use both versions of the module concurrently. How can I force installation to put them in a different directory??
  • Comment on Installing a newer version of a module without replacing the existing one.

Replies are listed 'Best First'.
Re: Installing a newer version of a module without replacing the existing one.
by arturo (Vicar) on Jan 17, 2001 at 20:18 UTC
    perl Makefile.PL PREFIX=/path/to/directory/where/you/want/it/to/go

    Or you could look through perlmodinstall (I'd look on my own system w/ "perldoc perlmodinstall")

    As a last resort, you could do a search on this on this site before posting the question, it's been asked before =)

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Re: Installing a newer version of a module without replacing the existing one.
by Elgon (Curate) on Jan 17, 2001 at 21:39 UTC
    This is an interesting point: how about in Perl 6 being able to use require or a variant of use to be able to specify which of two versions of a given module you have to use in the script.

    Elgon

      how about in Perl 6 being able to use require or a variant of use to be able to specify which of two versions of a given module you have to use in the script.

      This already exists in Perl 5.

      perldoc -f use

      =item use Module VERSION LIST If the VERSION argument is present between Module and LIST, then the C<use> will call the VERSION method in class Module with the given version as an argument. The default VERSION method, inherited from the Universal class, croaks if the given version is larger than the value of the variable C<$Module::VERSION>. (Note that there is not a comma after VERSION!)

      Tony

        The VERSION argument does not specify which version of a module to use, from multiple installed versions. Rather, as this snippet of documentation states: after the module has been loaded (which will be the first occurence of the module in @INC, regardless of VERSION), Perl will die if $Module::VERSION is less than the VERSION argument.

        This is just like putting require 5.005; in your Perl script. It won't change which perl executable is used to run your script; it will simply die if the executable used isn't a recent enough version.

        No, that checks whether you got as new of a version as you requested. It does not let you pick between multiple versions that are installed.

                - tye (but my friends call me "Tye")