On Sat, Jul 24, 2004 at 02:23:10PM -0700, Brent 'Dax' Royal-Gordon wrote:
> Jonadab the Unsightly One wrote:
> 
> >Oh, and here's me resisting the urge to suggest that use ought to
> >automatically install from the CPAN anything that isn't present, as a
> >core behavior right out of the box.
> 
> Security nightmare.

Definitely.  On the other hand...I find myself wondering if we could
offer a pragma so that people can have the option if they want it.
For example:


#!/usr/bin/perl6

#use warnings;  # Note that I am NOT explicitly using these
#use strict;

{   no 'warnings'; no 'strict';   # These must be explicitly turned off...
    no installation_security;     # or this would throw warning & error

    use SomeModule;     #
    use OtherModule;    # 
    use Foo;            # If these are not installed,
    use Bar;            # they will be auto-installed.
    use Baz;            #
    use Jaz;            #
}

use FrobNitz;           # If this is not installed, the script fails.

<script goes here>

__END__


Voila, this is now a completely portable-with-zero-effort(*) script.
Anywhere that I install it, it will ensure that all of its prereqs are
available before starting...and, if they aren't, it will install them
instead of failing.  That's pretty darn cool.

And I had to make a concerted effort to enable this behavior.  Really,
if the user wants to shoot himself in the foot, who are we to
interfere?

Note that there are still plenty of issues remaining--how to handle
varying module versions springs to mind--but those are implementation
details. 


--Dks

(*) Note that here, "zero-effort" means "assuming you have a net
connection, plus all necessary installation tools, plus the rights to
install, plus your system is configured correctly to use the
installation diretory (if not in the standard paths), etc".

Reply via email to