On Sun, Apr 29, 2001 at 11:44:24AM -0400, Dan Sugalski wrote:
> At 04:30 PM 4/29/2001 +0100, Michael G Schwern wrote:
> >To use a Perl 5 example, consider the simple setting of "use strict"
> >as a general site policy.  Basicaly, most of the Perl code in your
> >/usr/bin will explode when you try to run it.
> 
> Right, that's why the policy stuff we're discussing is optional... :)

Ugg, we're definately rehashing the .perlrc discussion now. :(

By "optional" I take it you mean an admin can choose to define their
own site policy or not?  

I see this as causing more trouble than its worth.  Consider the
following post Perl6 laments...

"Oh damn, this won't work under <insert naughty OS here> because they
ship with a messed up policy file!"

There's no real good solution to this one anymore than there's a good
solution to people shipping with dead perls.


"Grrr, I can't run <insert program here> because the admin has an odd
Perl policy setup"

This one could be dodged by having $HOME/.perl_policy (oops, I almost
typed '.perlrc' :) files which override the site-wide policy.  But the
idea of programs running differently depending on which user you are
makes my brain hurt.  It also waters down one of the intents of a site
policy which is to keep users from doing naughty/silly things.  Of
course, the site policy could deny being overriden by the user
policy... but then that brings us right back to square one.


In general, easy, customizable configurations are for applications,
not languages.  Go with 'use Policy::...' on each script.  A site-wide
policy is easily gotten by simply defining /usr/bin/perl as a shell
alias:

        #!/bin/sh

        /usr/bin/realperl -MPolicy::Company $@

Or something like that.  Before anyone brings up "but that fork will
slow things down!" consider the startup search for site policy files
that will have to occur when *every* perl program runs if you go that
route (then again, we already do that with Config.pm and other
libraries).


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <[EMAIL PROTECTED]>       Kwalitee Is Job One
Maybe they hooked you up with one of those ass-making magazines.
        -- brian d. foy as misheard by Michael G Schwern

Reply via email to