On Fri, Feb 16, 2001 at 06:33:46PM -0500, [EMAIL PROTECTED] wrote:
> On Fri, Feb 16, 2001 at 02:48:01PM -0800, Edward Peschko wrote:
> >     1) be lax on warnings and strict in a script, assume strictness and
> >            warnings in the modules. Rationale: in a script, you really 
> >        have an audience of one. With few exceptions, you are only 
> >            running the script for yourself.
> > 
> >        With a *module* however, you should know better. Since you
> >            are intending your code to work with the 'outside world', you
> >            have a civic duty to make your interface clean. And if you
> >            really know what you are doing, you can turn off the warnings,
> >            strictness as you see fit.
> 
> Its a fine rationale, but I'm very, very loathe to implicitly split
> Perl into two seperate languages based on what the filename is.

Why? Its not the filename, its how its used - 

        require("A"); # library - strict, warnings on
        use A;        # library - strict, warnings on
        do "A"        # library - strict, warnings on but who cares, do is 
                      # hardly ever used.

        eval("\$a = '1'");    # code - strict off

The functionality for adding 'strict' and 'warnings' would be added onto use 
and require. Just as require is a wrapper around do, and use is a wrapper around
require, the new use would be use + strict, warnings and so on. The only thing 
that would change in perl6 is the contents of the wrappers.

> >          2) provide a flag (-W ) which is a combo of 'use strict' and 
> >             'use warn' for scripts. Perhaps the -W should have warning
> >             levels ie - '-W1' means just warn, '-W2' == warn + strict,
> >             etc etc etc.; 
> 
> It doesn't make much sense to make 'strict' an easy command line flag.
> strict is something you want on either all the time or not at all
> (with regards to a single program).

Well, its the converse of '-q'. If people are too damn lazy to type '-q' and
get what they want, well hell, I'll just have to type '-W'. And its less typing
than '-w -Mstrict' or 'use strict; use warnings;'

Ed

Reply via email to