in reply to Perl 6 Module manager

Sounds like you want CPAN::AutoINC.

Such behavior can't have such wide-spread appeal that it would make it as a switch in the perl interpreter. (I know I'm against it anyway :) However, there's nothing stopping someone from setting up their particular installation to do something like this.

As for making scripts "more portable", I don't think so. What happens when someone uses this feature on a Windows system and perl automatically downloads and attempts to install a module that's Unix-specific? Or a module that requires a C compiler?

Replies are listed 'Best First'.
Re^2: Perl 6 Module manager
by sfink (Deacon) on Apr 19, 2006 at 15:59 UTC
    I think the OP means "portable" in the sense "portable between otherwise equivalent machines with different sets of modules installed." That's a significant win; at a workplace, there will be dozens of desktop machines, and if you're writing scripts for other people to run, you have to be sure to only use modules that are available everywhere (or preinstall the ones you need everywhere.) But the base OS is still the same. I'm not going to worry about whether that fits a purist definition of "portable".

    I wouldn't use the suggested mechanism because of the security concerns. But I might if the security concern wasn't there -- and as I read this thread, it struck me that it's fairly easy to remove: when requesting a module, request it using an exact version and a cryptographic digest. I'd probably want the digests to be listed in a separate file, both to avoid messing up the main script and to allow for dependencies. For any missing module, you'd download the requested version and check its digest before installing it. I know that CPAN can already check signatures, but that still relies on an external source for the signatures to check against. And I also like the notion that you could depend on getting the exact versions of things that you originally wrote your script against, so you don't need to worry about some module changing its interface out from under you.

    It doesn't deal with the problem where a different version is already installed on the system, but it doesn't make that problem any worse either. It would just use whatever's there if some version existed, and you have no more than the usual version compatibility problems. It could even warn in such cases, which is better than what we get now.

    Or think of it this way: you could bundle up a script with the complete source for all modules it uses, and it unpacks and installs them all when it first runs if they aren't already on the system. The proposed idea does exactly that, except it uses unfakable pointers to each module rather than the actual data comprising the module.